Author_Institution :
Sch. of Comput. Eng., Univ. of Electron. Sci. & Technol. of China, Zhongshan, China
Abstract :
How to efficiently transfer data among parallel threads is a research hotspot. A common data structure of transferring data among parallel threads is queue. Some writer threads write data into one side of the queue, and reader threads read data from the other side of the queue. Running in parallel environments, some sources, such as shared variables, are critical resources, which require atomic operation. One naive way to guarantee the correctness is to impose a lock on critical resources. However, lock is a heavy system mechanism, and is of low efficiency. In this paper, a highly effective single-in-single-out lock-free queue is devised by utilizing some important hardware properties and techniques, such as thread-local variables, fast modulo operations and cache-line padding, etc. A single-in-multi-out lock-free queue and a multi-in-multi-out lock-free queue are also proposed. Experimental results in the end show the effectiveness of our methods.
Keywords :
electronic data interchange; parallel processing; atomic operation; cache-line padding; data exchange; data structure; data transfer; fast modulo operations; multi-in-multi-out lock-free queue; parallel computing; parallel threads; shared variables; single-in-multi-out lock-free queue; single-in-single-out lock-free queue; thread-local variables; Hardware; Instruction sets; Magnetic heads; Message systems; Monitoring; Parallel processing; Synchronization; data exchange; parallel computing;