Lock pairing

In Java bytecode, there no implicit way of keeping track of which particular monitorenter instruction(s) (locks) are paired with which particular monitorexit instruction(s) (unlocks), even though this is explicit and undeniable in Java source code. In order to perform some lock operations quickly and in order to support, for example lazy unlocking and recursive locking with low overhead, it is a good idea to let the code generator try to figure out which locks correspond to which unlocks. This is done in JRockit and is referred to as lock pairing. Lock pairing involves associating lock and unlock instructions with a "lock token", uniquely identifying the lock/unlock pair.

See also Lazy unlocking, Recursive locking, and Lock token ...

Get Oracle JRockit now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.