• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Page Information

    Loading...
  1. Dashboard
  2. Undefined Space
  3. HotSpot
  4. Synchronization

Page History

Versions Compared

Old Version 3

changes.mady.by.user Christian Wimmer

Saved on Apr 23, 2008

compared with

New Version 4

changes.mady.by.user Christian Wimmer

Saved on Apr 29, 2008

  • Previous Change: Difference between versions 2 and 3
  • Next Change: Difference between versions 4 and 5
  • View Page History

Key

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

...

A similar mechanism, called bulk rebiasing, optimizes situations in which objects of a class are locked and unlocked by different threads but never concurrently. It invalidates the bias of all instances of a class without disabling biased locking. An epoch value in the class acts as a timestamp that indicates the validity of the bias. This value is copied into the header word upon object allocation. Bulk rebiasing can then efficiently be implemented as an increment of the epoch in the appropriate class. The next time an instance of this class is going to be locked, the code detects a different value in the header word and rebiases the object towards the current thread.

Source Code Hints

Synchronization affects multiple parts of the JVM: The structure of the object header is defined in the classes oopDesc and markOopDesc, the code for thin locks is integrated in the interpreter and compilers, and the class ObjectMonitor represents inflated locks. Biased locking is centralized in the class BiasedLocking. It can be enabled via the flag -XX:+UseBiasedLocking and disabled via -XX:-UseBiasedLocking. It is enabled by default for Java 6 and Java 7, but activated only some seconds after the application startup. Therefore, beware of short-running micro-benchmarks. If necessary, turn off the delay using the flag -XX:BiasedLockingStartupDelay=0.

References

Wiki Markup
<ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="ce958f69cfc0c679-db3f294a-4f5c49b0-80219325-c5808080ffe7b4d0c2e313f4"><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="2490a8cfa81d11a5-3774473e-4839462b-a56aa6fd-f1349b6d897ae4de83a5e9f0"><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="af6f8f6521e7f11b-8d768767-469540eb-bda6939a-bd7a37d797932c7b05c82980"><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="13c42e785bef29ab-397df29a-40e3435f-b98c9b30-2985abbad93779c35ab25f30"><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]

Overview
Content Tools
ThemeBuilder

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.23
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 220, "requestCorrelationId": "305fbf179eb91903"}