Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Read-write lock optimization method, device and system and storage medium

An optimization method and technology of read-write lock, applied in the field of read-write lock, can solve problems such as B thread is in a waiting state, deadlock, etc.

Pending Publication Date: 2020-05-12
LENOVO (BEIJING) LTD
View PDF6 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In this case, there will be the following problems: suppose thread A already holds a read lock, and thread B applies for a write lock. "deadlock"

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
  • Read-write lock optimization method, device and system and storage medium
  • Read-write lock optimization method, device and system and storage medium
  • Read-write lock optimization method, device and system and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0023] In order to make the objectives, features, and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described The embodiments are only a part of the embodiments of the present invention, but not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work shall fall within the protection scope of the present invention.

[0024] In the description of this specification, descriptions with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" etc. mean specific features described in conjunction with the embodiment or example , Structure, materials or features are included in at least one embodiment or e...

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

The invention discloses a read-write lock optimization method, device and system and a storage medium. The method comprises the following steps: firstly, receiving all locking requests by a to-be-scheduled queue, wherein the locking requests comprises a read lock request and a write lock request, and orderly inserting the locking request into the to-be-scheduled queue according to a read lock priority principle, so that the read lock request is ranked in front of the write lock request, the read lock can be ensured to be processed preferentially, and the characteristics and advantages of an original read-write lock method are ensured; then, under the condition of meeting the specified condition, moving all the locking requests in the to-be-scheduled queue to a to-be-executed queue according to an original sequence; and the locking requests in the to-be-executed queue are sequentially processed according to the read-write lock method, so that all the locking requests in the to-be-scheduled queue before can be processed, and the situation that the writing lock requests are blocked for a long time and cannot be processed is avoided.

Description

Technical field [0001] The invention relates to the field of read-write locks, in particular to a method, device, system and storage medium for optimizing read-write locks. Background technique [0002] When multiple threads share the same resource, the thread safety problem will not occur when multiple threads read the shared resource at the same time, but once one thread writes the shared data, other threads read and write the shared resource. Otherwise, data security issues will occur, so a read-write lock appears. The read-write lock allows multiple threads to acquire the read lock at the same time, but after one thread acquires the write lock, other threads will enter the waiting queue to wait. Read-write locks are especially suitable for scenarios where most of the cases are read and only a few cases are write, and it is a key solution technology for maintaining data consistency. [0003] Currently, the read-write lock in the standard library is an opportunistic lock. Once...

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/52
CPCG06F9/524
Inventor 娄婷
Owner LENOVO (BEIJING) LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products