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

Method and device for accessing shared data between multiple threads

A data-sharing and multi-threading technology, which is applied in the field of accessing shared data between multiple threads, can solve the problem of multiple forwarding thread blocking, and achieve the effect of avoiding thread blocking

Active Publication Date: 2017-10-31
NEUSOFT CORP
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0009] In view of the above problems, the purpose of the present invention is to provide a method and device for accessing shared data between multiple threads, to solve the problem that multiple forwarding threads use a lock mechanism to access shared data in parallel, causing multiple forwarding threads to block

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 device for accessing shared data between multiple threads
  • Method and device for accessing shared data between multiple threads
  • Method and device for accessing shared data between multiple threads

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0035] In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of one or more embodiments. It may be evident, however, that these embodiments may be practiced without these specific details. In other instances, well-known structures and devices are shown in block diagram form in order to facilitate describing one or more embodiments.

[0036] In the prior art, forwarding threads access shared data in parallel using a lock mechanism, which is likely to cause blocking between forwarding threads. In order to realize the lock-free access mechanism of forwarding threads to shared data, the present invention utilizes the atomic operation of the operating system The mechanism, that is, the assignment and read operations of simple variables are atomic, and the forwarding thread's access to shared data is converted into an atomic operation to ensure that the timing of the forwarding thread's reading...

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 device for accessing shared data among multiple threads. The method comprises newly adding a control structure and a global pointer variable, pointing at a current shared data block through the control structure, in the current shared data block, newly establishing a shared data block when the shared data is updated, ensuring that the global pointer variable points at the newly established shared data block through a mode of modifying the value of the global pointer variable, encapsulating the multiple threads, and ensuring that the encapsulated threads read shared data in the shared data block through the global pointer variable. By adopting the method and the device for accessing the shared data among the multiple threads and by converting the accessing of complex shared data by forward threads into the accessing of the simple variable, accessing the complex shared data by the forward treads in a lock mechanism is replaced, and tread blockage caused when the forward treads assess the shared data can be effectively avoided.

Description

technical field [0001] The present invention relates to the technical field of multi-thread access to shared data, and more specifically, to a method and device for multi-thread access to shared data. Background technique [0002] With the development of cpu multi-core technology and the support of operating systems, multi-thread programming has been widely used in computer software implementations in various fields. The multi-threaded architecture mode is a user mode program architecture under the LINUX system that is widely used in the industry at present. This architecture mode is also applied in the network packet sending and receiving system of firewall products. Its software structure is as follows: figure 1 As shown, during system operation, a configuration thread is usually created to be responsible for writing data, and there will be multiple forwarding threads running in parallel to dynamically obtain the latest configuration data. For the above software structure...

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 Patents(China)
IPC IPC(8): G06F9/46
Inventor 王海峰刘申陈静相
Owner NEUSOFT CORP