|
Why is ReentrantLock faster than synchronized ?: msg#00030java.jsr.166-concurrency
Hi, a recent article by Brian Goetz made me wonder about this again. Brian demonstrates, how ReentrantLock has a performance and scalability advantage over synchronized. Did anyone investigate why that would be the case? Is it due to the fact that the VM has lock-enable *any* java.lang.Object through things like header displacement, lock inflation/deflation? Or has GC an advantage over manual management of lock records? Other than that I cannot think of any edge ReentrantLock could have over synchronized: both codes are generated inline by the Hotspot compiler, both can and probably do use the same suspension/resumption methods, the same atomic instruction sequences, ... Just wondering Matthias -- Meet us at CeBIT: Launching CoreMedia CMS 2005, Hall 3, D09.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: volatile long, David Holmes |
|---|---|
| Next by Date: | Re: Why is ReentrantLock faster than synchronized ?, Doug Lea |
| Previous by Thread: | volatile long, Hanson Char |
| Next by Thread: | Re: Why is ReentrantLock faster than synchronized ?, Doug Lea |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |