维基百科上,对于乐观锁和悲观锁的定义是限定在关系型数据库上的。
但是在语言层面上,比如java,是否有这样的概念?实现都有什么呢?
PHP中文网2017-04-17 13:08:39
The concept of "lock" is not limited to a specific language implementation. He feels that it is more appropriate to accompany the multi-threading model.
The shadow of locks will be seen wherever critical resource access is involved. Optimistic locking and pessimistic locking are just two more detailed models of locks. The mysql database is implemented in C language. It also involves multiple threads accessing a data at the same time, two people writing at the same time, one person writing and one reading, two people reading at the same time, etc. So locks are not limited to relational databases.