Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

One of the major strengths of the Java programming language is its built-in support for multi-threaded programs. An object that is shared between multiple threads can be locked in order to synchronize its access. Java provides primitives to designate critical code regions, which act on a shared object and which may be executed only by one thread at a time. The first thread that enters the region locks the shared object. When a second thread is about to enter the same region, it must wait until the first thread has unlocked the object again.

Wiki Markup
In the Java HotSpotHotSpotâ„¢ VM, every object is preceded by a class pointer and a header word. The header word, which stores the identity hash code as well as age and marking bits for generational garbage collection, is also used to implement a _thin lock scheme_ \[[Agesen99|#Agesen99], [Bacon98|#Bacon98]\]. The following figure shows the layout of the header word and the representation of different object states.

...

Wiki Markup
<ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="85396e678172ca9e-7a9bef1f-4bb64ad5-b632a670-b70e5c4ca6b5d2fbbd45f35a"><ac:parameter ac:name="">Agesen99</ac:parameter></ac:structured-macro>\[Agesen99\] O. Agesen, D. Detlefs, A. Garthwaite, R. Knippel, Y. S. Ramakrishna, D. White: _An Efficient Meta-lock for Implementing Ubiquitous Synchronization_. In _Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications_, pages 207-222. ACM Press, 1999. [doi:10.1145/320384.320402|http://dx.doi.org/10.1145/320384.320402]

Wiki Markup
<ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="54f917cf182d270f-aacf5955-4f05476f-abacbaf4-698c6373bc225771e0cf3bf3"><ac:parameter ac:name="">Bacon98</ac:parameter></ac:structured-macro>\[Bacon98\] D. F. Bacon, R. Konuru, C. Murthy, M. Serrano: _Thin Locks: Featherweight Synchronization for Java_. In _Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation_, pages 258-268. ACM Press, 1998. [doi:10.1145/277650.277734|http://dx.doi.org/10.1145/277650.277734]

Wiki Markup
<ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="00970923cf97757f-4df28ca1-4131411f-87b890d5-49a4d61591e2bd9fdc79facf"><ac:parameter ac:name="">Kawachiya02</ac:parameter></ac:structured-macro>\[Kawachiya02\] K. Kawachiya, A. Koseki, T. Onodera: Lock Reservation: Java Locks can Mostly do without Atomic Operations. In _Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications_, pages 130-141. ACM Press, 2002. [doi:10.1145/582419.582433|http://dx.doi.org/10.1145/582419.582433]

Wiki Markup
<ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="c4ae407beace4c3a-5bdc5cb5-4be040b9-b1f7acc7-b5a378ed8e930d45d500ec3a"><ac:parameter ac:name="">Russell06</ac:parameter></ac:structured-macro>\[Russel06\] K. Russell, D. Detlefs: Eliminating Synchronization-Related Atomic Operations with Biased Locking and Bulk Rebiasing. In _Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications_, pages 263-272. ACM Press, 2006. [doi:10.1145/1167473.1167496|http://dx.doi.org/10.1145/1167473.1167496]