Method and device for accessing shared data structure by multiple threads in parallel

一种共享数据结构、线程的技术,应用在多道程序装置、电数字数据处理、程序控制设计等方向,能够解决降低多核处理器性能等问题

Active Publication Date: 2010-03-31
INT BUSINESS MASCH CORP
View PDF0 Cites 24 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

In actual applications, when multiple threads frequently modify the data structure, there will be a lot of element movement as described above, and the overhead of these element movements will reduce the performance of the entire multi-core processor

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 structure by multiple threads in parallel
  • Method and device for accessing shared data structure by multiple threads in parallel
  • Method and device for accessing shared data structure by multiple threads in parallel

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0017] It is believed that the above and other objects, features and advantages of the present invention will be more apparent through the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings.

[0018] figure 2 It is a flow chart of a method for concurrently accessing a shared data structure by multiple threads in a parallel application program according to an embodiment of the present invention. The present embodiment will be described in detail below in conjunction with the accompanying drawings.

[0019] Such as figure 2 As shown, when multiple threads access a shared data structure in parallel, in step S201, each thread requests to acquire a lock for locking the shared data structure, and only one of the threads is granted the lock of the shared data structure. During the above-mentioned period when one thread acquires the lock, in step S210, the operations of the thread that acquires the lock are p...

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 method provides a method for accessing a shared data structure by multiple threads in parallel in parallel applications, which comprises the following steps: authorizing a lock of the shared data structure to one of the multiple threads; executing the operation of the thread which acquires the lock on the shared data structure; caching the operations of the threads which do not acquire the lock in the multiple threads; and in the subsequent time period in which another thread in the multiple threads acquires the lock of the shared data structure, executing the cached operations on the shared data structure. By utilizing the method, when the shared data structure is locked by one thread, the operations of other threads which do not acquire the lock of the shared data structure can be automatically cached; and when another thread acquires the lock of the shared data structure, all the cached operations can be executed, thereby obviously reducing the number of movements of elements in the shared data structure when modifying the shared data structure, and enhancing the performance of the multiple thread accessing. The invention also provides a corresponding device.

Description

technical field [0001] The invention relates to a parallel program used in a multi-core architecture, in particular to a method and a device for multiple threads in a parallel program to access a shared data structure in parallel. Background technique [0002] At present, microprocessor technology is entering the multi-core era from the single-core era, and multi-core processors are becoming mainstream and developing rapidly. In a multi-core processor, each CPU core can support multiple threads. As the demand for computing power of multi-core processors grows, parallel programming that can effectively utilize hardware parallelism is the most appropriate way. In parallel computing, computing speed can be increased by programming multiple CPU cores (processing units) in a multi-core processor to cooperatively solve a problem. To take full advantage of multi-core processors, parallel programs are often used, ie applications that include parallel processing. In a parallel pro...

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/50
CPCG06F9/526G06F2209/522
Inventor 甘志戴晓君邱模炯齐尧
Owner INT BUSINESS MASCH CORP
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