Non-blocking concurrent queues with direct node access by threads
AssigneeMicrosoft Corporation
InventorsAlessandro Forin, Andrew Raffman
Life of this patent
Estimating the term…
Loading patent…
AssigneeMicrosoft Corporation
InventorsAlessandro Forin, Andrew Raffman
Estimating the term…
Multiple non-blocking FIFO queues are concurrently maintained using atomic compare-and-swap (CAS) operations. In accordance with the invention, each queue provides direct access to the nodes stored therein to an application or thread, so that each thread may enqueue and dequeue nodes that it may choose. The prior art merely provided access to the values stored in the node. In order to avoid anomalies, the queue is never allowed to become empty by requiring the presence of at least a dummy node in the queue. The ABA problem is solved by requiring that the next pointer of the tail node in each queue point to a “magic number” unique to the particular queue, such as the pointer to the queue head or the address of the queue head, for example. This obviates any need to maintain a separate count for each node.
A method for one thread in a system capable of running plural threads to enqueue a new node onto a selected FIFO queue, said system capable of supporting plural FIFO queues, each queue comprising a succession of enqueued nodes and having a head pointer pointing to a head node of said succession of nodes and a tail pointer pointing to a tail node of said succession of nodes, each of said nodes having a next pointer, the next pointer of each of said enqueued nodes pointing to the next node in said succession from said head node to said tail node, said method comprising:
A method for one thread in a system running plural threads to dequeue a node from a selected FIFO queue, said system having plural FIFO queues, each queue comprising a succession of enqueued nodes and having a head pointer pointing to a head node of said succession of nodes and a tail pointer pointing to a tail node of said succession of nodes, each of said nodes having a next pointer, the next pointer of each of said enqueued nodes pointing to the next node in said succession from said head node to said tail node, said method comprising:
A method of constructing a FIFO queue data structure, comprising:
An IQueue object data structure, comprising:
A method of constructing and operating a FIFO queue in a system running plural threads and supporting plural FIFO queues, comprising:
Apparatus capable of running plural threads in which one of the plural threads can enqueue a new node onto a selected FIFO queue, said apparatus capable of supporting plural FIFO queues, each queue comprising a succession of enqueued nodes and having a head pointer pointing to a head node of said succession of nodes and a tail pointer pointing to a tail node of said succession of nodes, each of said nodes having a next pointer, the next pointer of each of said enqueued nodes pointing to the next node in said succession from said head node to said tail node, said apparatus comprising:
Apparatus capable of running plural threads in which one of said plural threads can dequeue a node from a selected FIFO queue, said apparatus capable of supporting plural FIFO queues, each queue comprising a succession of enqueued nodes and having a head pointer pointing to a head node of said succession of nodes and a tail pointer pointing to a tail node of said succession of nodes, each of said nodes having a next pointer, the next pointer of each of said enqueued nodes pointing to the next node in said succession from said head node to said tail node,
Dependencies are inferred from the claim text.