Implementation method of distributed priority queuing lock
An implementation method and priority technology, applied in the direction of program startup/switching, program control design, instruments, etc., can solve problems such as inability to acquire locks, achieve the effect of improving request experience, improving satisfaction, and optimizing the system
Active Publication Date: 2017-05-31
G CLOUD TECH
View PDF7 Cites 3 Cited by
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
[0007] The technical problem solved by the present invention is to provide a method for implementing a distributed priority queuing lock, which can ensure the efficiency of acquiring locks for concurrent requests in a distributed system with high concurrency, and solve the problem that there may be requests that cannot acquire locks. At the same time, it provides a A more flexible priority to meet various special requests
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 moreImage
Smart Image Click on the blue labels to locate them in the text.
Smart ImageViewing Examples
Examples
Experimental program
Comparison scheme
Effect test
Embodiment Construction
[0028] Such as figure 1 Shown, the implementation process of the present invention is as follows:
[0029] Main process:
[0030]
[0031]
[0032]
[0033]
[0034] Release the lock:
[0035]
[0036]
[0037]
[0038] Queue to acquire locks:
[0039]
[0040]
[0041]
[0042]
[0043] Update priority and judge whether to join the queue:
[0044]
[0045] Set priority:
[0046]
[0047] .
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
Login to View More
Abstract
The invention relates to the technical field of distributed concurrence and JAVA development, in particular to an implementation method of a distributed priority queuing lock. The method includes: setting priority for a request which needs operation; starting acquiring the lock, judging whether mutex fields in a database are empty or not, if not, determining that lock acquiring fails, or else judging whether a waiting object exists in a queue or not, whether the request is in the queue or not and whether the request is at the first position or not, if so, setting the mutex fields, or else determining that lock acquiring fails; determining that lock acquiring succeeds if the mutex fields are set successfully, and releasing the mutex fields after the request is processed; when the lock acquiring fails and if the request is not in the queue, promoting the priority, adding the request into the queue when the priority is promoted to a preset value, repeating the steps until the lock is acquired successfully or timeout occurs. The implementation method has the advantages that the problems that the request is possibly unable to acquire the lock, the lock acquiring efficiency is low and the priority is inflexible are solved, and the method is applicable to a distributed environment which is large in concurrence volume and needs priority processing of specific requests.
Description
technical field [0001] The invention relates to the technical field of distributed concurrency and JAVA development, in particular to a method for realizing distributed priority queuing locks. Background technique [0002] When dealing with data exceptions caused by concurrent system requests, locks are generally used. In distributed systems, memcached or redis distributed locks are generally used to implement. However, when the amount of concurrency is increasing and the request situation is becoming more and more complex, the existing solution will have the following problems: [0003] One is that the existing distributed lock solution is preemptive, and whoever gets it first will process it first. Moreover, in the case of a large amount of concurrency, it may take a long time to process a request because the lock cannot be grabbed, or even the lock cannot be grabbed all the time, resulting in the inability to process the request; [0004] The second is that the queuing ...
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
Login to View More
IPC IPC(8): G06F9/48
CPCG06F9/4831G06F2209/484
Inventor 姚文俊杨松季统凯
Owner G CLOUD TECH
Who we serve
- R&D Engineer
- R&D Manager
- IP Professional
Why Eureka
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Social media
Eureka Blog
Learn More Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com