Method and system for multi-thread synchronization in distributed system

A distributed system, multithreading technology, applied in distributed object-oriented systems, program synchronization, multiprogramming devices, etc., can solve problems such as low efficiency, lack of support for multi-condition thread synchronization, lack of notification synchronization threads, etc. The effect of high utilization rate and improved efficiency

Active Publication Date: 2016-06-22
BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF7 Cites 33 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] 1. All threads query whether they can access resources through active polling, which is inefficient; and when resources are released, there is no mechanism for notifying synchronization threads;
[0007] 2. It does not support flexible and self-defined multi-condition thread synchronization, that is, each thread can actively choose to block according to self-defined conditions or wake up the corresponding thread according to self-defined conditions

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
  • Method and system for multi-thread synchronization in distributed system
  • Method and system for multi-thread synchronization in distributed system
  • Method and system for multi-thread synchronization in distributed system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0030] Exemplary embodiments of the present invention are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present invention to facilitate understanding, and they should be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.

[0031] figure 1 It is a schematic diagram of main steps of a method for multi-thread synchronization in a distributed system according to an embodiment of the present invention. Such as figure 1 As shown, the multi-thread synchronization method in the distributed system of the present invention mainly includes the following steps S11 to S13.

[0032] Step S11: receiving...

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 provides a method and a system for multi-thread synchronization in a distributed system. The method and the system can support the flexible control of the multi-thread synchronization under custom conditions and achieve the purpose that a thread takes the initiative to release a resource and accurately awakens a related waiting thread, and are high in resource utilization rate. The method for the multi-thread synchronization in the distributed system comprises the following steps: receiving a resource control request of the thread, wherein the request has a parameter, and the parameter comprises an identification of the thread and a resource name of the requested resource; reading data of a resource node of the resource according to the resource name; trying to lock the resource, wherein when locking fails, the identification of the thread is placed on a waiting queue of the resource, so that the thread enters a blocking state; when the locking is successful, the thread controls the resource, and the resource is released after the thread utilizes the resource to complete execution; other threads in the waiting queue of the resource are awakened, wherein the awakened threads can try to lock the resource.

Description

technical field [0001] The invention relates to the technical field of computers and software thereof, in particular to a multi-thread synchronization method and system in a distributed system. Background technique [0002] When multiple threads are used to access the same data, it is very easy to have security problems, for example: multiple threads are operating the same data, resulting in data inconsistency, etc. Therefore, we need to use a synchronization mechanism to solve these problems, that is, thread synchronization. Thread synchronization means that when multiple threads access the same resource at the same time, it is necessary to ensure that the resource can only be exclusively occupied by one thread at a time. The mainstream approach now is to divide the data into blocks to achieve data isolation. However, some applications have to take advantage of thread synchronization in distributed systems. [0003] In a distributed system, because applications are deplo...

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/46G06F9/50G06F9/52G06F9/54
CPCG06F9/465G06F9/5022G06F9/5083G06F9/52G06F9/546
Inventor 魏亚文孙政
Owner BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD
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