Block Synchronization 同步块 ; 块同步
The synchronization block was performed before the staff query was done on the work item.
同步块在工作项目上的员工查询完成之前执行。
The synchronization block was limited to one JVM and a possibility still existed that a request is routed to another node in a cluster and causes the concurrency exception in the receiving node.
同步块被限制在一个JVM上,请求被路由到集群中的另一个节点并引起接收节点中的并发异常,这种可能性仍然存在。
If you have two operations that require synchronization separated by a small block of thread-safe code, you are generally better just using a single synchronized block.
要是您想用一小块线程安全代码把要求同步的两个操作隔开,那么只使用一个同步块一般会更好些。
应用推荐