简体   繁体   中英

intrinsic lock of an object on Linux JVM

I learnt that:"Every object has an intrinsic lock associated with it."

I also learnt that on linux, JVM internally uses POSIX api's for multi-threading feature.

What is the name of the POSIX api that JVM uses to provide(create) an intrinsic lock for each object instance of a class?

The locks the JVM use to implement synchronized are not operating system locks, but is implemented internally in the JVM.

This is for speed reasons as well as they lock something different. The operating system has no special understanding of Java objects (as opposed to files, memory and so on) so the JVM has its own locking mechanism specially designed for this.

A lot of effort has gone into making this very fast.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM