Inter-process thread mutex method

An inter-thread and cross-process technology, applied in the field of mutual exclusion between cross-process threads, can solve the problem that shared resources cannot be mutually exclusive access, etc.

Active Publication Date: 2016-04-20
CSSC SYST ENG RES INST
View PDF6 Cites 16 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0011] In view of the above-mentioned analysis, the present invention aims to provide a method for mutual exclusion between cross-process threads, in order to solve the problem of mutual exclusion of shared resources under Linux in the prior art.

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
  • Inter-process thread mutex method
  • Inter-process thread mutex method
  • Inter-process thread mutex method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0054] Preferred embodiments of the present invention will be specifically described below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of the application and are used together with the embodiments of the present invention to explain the principle of the present invention.

[0055] The specific embodiment of the present invention adopts the named semaphore mechanism of the SystemV standard in the Linux system, so the description below is based on the named semaphore. A non-negative integer is stored in the well-known semaphore, and all threads passing through it will decrement the integer by 1. When the integer value is 0, all threads trying to enter the critical section through it will be in a waiting state until the previously passed The thread releases the well-known semaphore, and once it is released, it will add 1 to the integer. Once the integer value is greater than 0, a new thread will pass.

[0056] A method of mut...

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 relates to an inter-process thread mutex method. The inter-process thread mutex method comprises following steps: vying for mutex information by multiple threads and initializing mutex information by a successful thread; when obtaining mutex information by the successful thread and utilizing mutex information to lock a critical zone; obtaining a lock of mutex information by the thread after locking operation and visiting shared resources; waiting by other threads at the same time; parting the critical zone after the threads run out of shard resources; and continuing to compete for mutex information by other threads and repeating above steps. The inter-process thread mutex method has following beneficial effects: combined with a semaphore mechanism, atomicity of locking and unlocking is ensured; the method has thread safety and helps to effectively solve the problem of garbage value obtained by mutex information; abnormity is avoided when garbage value is obtained by using threads; the deadlocking problem is also overcome when the self body asks for a lock during locking; and the problem of unlocking out of limits of authority is avoided.

Description

technical field [0001] The invention relates to the technical field of information processing, in particular to a method for mutual exclusion between cross-process threads. Background technique [0002] Modern operating systems adopt a multi-programming mechanism, multiple processes can be executed concurrently, and each process contains multiple threads, and the CPU switches back and forth between threads to share certain resources and improve resource utilization. It also makes it a difficult problem to deal with conflicts and mutual constraints between multiple threads of concurrent execution. If the scheduling of concurrent threads is improper, the running result may be related to the switching time, making the result irreproducible, affecting the efficiency and correctness of the system, and even causing the system to crash directly in severe cases. Some mechanism is needed to control this interdependence between concurrent threads. [0003] There are usually two kind...

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/526
Inventor 秦远辉周林宏王永炎晏琪亓卓然王盖罗雄飞
Owner CSSC SYST ENG RES INST
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
Try Eureka
PatSnap group products