什么是线程
Threads are : "the smallest unit of processing that can be scheduled by an operating system". Each OS has its own implementations of threads, but basically a process contains a set of instructions (code) plus a piece of memory local to the process. A thread runs a piece of code but shares the memory space with the process that contains it. In Linux (this queue I'm writing about was firstly intended to work in this OS) a thread is just another "context of execution", in this OS there "is no concept of a thread. Linux implements threads as standard processes. The Linux kernel does not provide any special scheduling semantics or data structures to represent threads. Instead, a thread is merely a process that shares certain resources with other processes."
原文介绍了一种无锁队列的实现,其中对一些基本概念,如线程、线程同步与性能的影响等做了细致的说明
Yet another implementation of a lock-free circular array queue by Faustino Frechilla