Unlock instant, AI-driven research and patent intelligence for your innovation.

Synchronized lock degradation method and device based on JVM Markword and medium

A lock-type, object technology, applied in the computer field, can solve the problems of not supporting lock downgrade, platform service stuck, affecting user experience, etc., to achieve the effect of improving operating efficiency

Pending Publication Date: 2022-04-08
INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

JDK itself has made a lot of optimizations for synchronized, including lock upgrades (lock-free---biased lock---lightweight lock---heavyweight lock), but it does not support lock downgrade, which leads to high concurrency scenarios In this case, the platform service is obviously stuck, which seriously affects the user experience
The third-party framework and the display lock of Java itself can solve the above problems to a certain extent, but the cost of modification is relatively high, and it needs to be reset every time the code is written, and the scope of automatic testing is relatively large

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Synchronized lock degradation method and device based on JVM Markword and medium
  • Synchronized lock degradation method and device based on JVM Markword and medium
  • Synchronized lock degradation method and device based on JVM Markword and medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0039] To make the purpose, technical solutions and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.

[0040] Such as figure 1 As shown, the first aspect of the embodiments of the present invention proposes a JVM Markword-based Synchronized lock downgrade method, including:

[0041] Step S1, obtaining the object header information of the object, and constructing the object header data structure of the object in the JVM according to the object header information of the object;

[0042] Step S2, in response to the construction of the object header data structure is completed, the lock record information table of the object is established according to the object header data structure;

[0043] Step S3, update the lock times of the thread in the lock record information table of the object according to the lock acc...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

A Synchronized lock degradation method based on JVM Markword comprises the steps that object header information of an object is obtained, and an object header data structure of the object is constructed in JVM according to the object header information of the object; in response to completion of construction of the object header data structure, establishing a lock record information table of the object according to the object header data structure; updating the locking times of the thread in a lock record information table of the object according to the locking type access times of the thread to the object; and degrading the object lock of the object into a lightweight lock in response to the condition that the object lock of the object is a weight lock and the number of locking times of the thread in the lock record information table of the object reaches a preset number of times. Through the method provided by the invention, the problem that the lock of the object cannot be degraded in the prior art can be effectively solved, the running efficiency of the Java program is improved, and the method does not depend on the compatibility of a third-party library, and is efficient and convenient.

Description

technical field [0001] The invention belongs to the field of computers, and in particular relates to a JVM Markword-based Synchronized lock downgrade method, equipment and media. Background technique [0002] The artificial intelligence platform is built using Java as the basic development language. In multi-threaded concurrent business scenarios, the R&D team uses the synchronized keyword in Java to achieve thread synchronization and ensure the correctness of business data. JDK itself has made a lot of optimizations for synchronized, including lock upgrades (lock-free---biased lock---lightweight lock---heavyweight lock), but it does not support lock downgrade, which leads to high concurrency scenarios In this case, the platform service is obviously stuck, which seriously affects the user experience. The third-party framework and the display lock of Java itself can solve the above problems to a certain extent, but the cost of modification is relatively high, and it needs to...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/455G06F9/48G06F9/52G06F8/41
Inventor 孙辽东
Owner INSPUR SUZHOU INTELLIGENT TECH CO LTD