Lock 和 synchronized

jvm:synchronized

Code layer: Lock

The advantage of LOCK: there are read locks and write locks

During the wait time, no response returns false, otherwise true

Read more and write less, hope to be faster than synchronized

 

Concurrency:

Synchronized, lock of simple program (single node)

Multi-node: Most of the row-level locks of the database are independent of a public resource, which is used as the only object for lock processing

Distributed processing

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326864682&siteId=291194637