You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf: an uncontended ReentrantLock lock and unlock costs about 600 ns, 9 times a monitor #136
An uncontended ReentrantLock lock and unlock costs about 550 to 600 ns on java-web, while a synchronized block costs 65 ns and a volatile read 9 to 15 ns. HotSpot on the same machine takes 22 ns for the lock and 20 ns for the monitor. Libraries that guard a getter with a ReentrantLock then pay about half a microsecond per read.
Expected: an uncontended ReentrantLock near the cost of a monitor, as on HotSpot. Its fast path is a compareAndSetState on an AbstractQueuedSynchronizer and a setExclusiveOwnerThread.
Activity