[concurrency-interest] Synchronization automatic with Lock in JVM
nathani.vijay at gmail.com
Wed Oct 12 01:07:06 EDT 2005
I am using Sun JVM 5.0.
The javadoc for Lock interface says
"All Lock implementations must enforce the same memory synchronization semantics as provided by the built-in monitor lock:
a.. A successful lock operation acts like a successful monitorEnter action
b.. A successful unlock operation acts like a successful monitorExit action "
So does that mean that acquiring a lock is as good as entering a synchronization block i.e. will all the buffered variables be discarded?
Also does that mean that releasing a lock is as good as leaving a synchronization block i.e. will all the buffered changed variables be flushed to RAM?
My apologies if this doubt is too basic.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest