In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what are the knowledge points related to java thread". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. let's study and learn "what are the knowledge points related to Java thread"?
Cas compare and swap (exchange):
Read the current value
Calculated result value
Compare current values with memory values
Update new valu
ABA question, adding additional fields
The underlying primitive lock (hardware lock signal) cmpxchg
Java object memory layout
Object header (markword, class point, on 64-bit system, jvm enables compression to 4 bytes, does not enable to 8 bytes), (array length-4 bytes) instance data, alignment (improves efficiency by system bus bits), as shown below
Lock up (downgrade) process
New- > bias lock-> lightweight lock (no lock, spin lock, adaptive spin lock)-> weight lock
Bias lock (default delay 4 seconds plus)-> add a pointer to the lock object in the object's markword
Lightweight locks-> contending threads contend to point to the lock object in the way of cas
Heavy lock-> user mode applies for system lock from kernel mode, and all other competing threads are queued after the application (reduce resource consumption)
Lock downgrade: it usually occurs in the case of gc, so the downgrade is meaningless at this time
Lock elimination: implicit elimination of internal locks when references are not called by other threads
Lock coarsening: value lock outermost operation (such as while (I) for the same operation on a set of objects
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.