Patent ID: 6668291
Filing Date: 2003-12-23
Classification: G06F

Abstract:
A method for a first thread in a system capable of running plural threads to enqueue a new node onto a selected queue, said system capable of supporting plural queues, each queue comprising a succession of enqueued nodes and having a head pointer pointing to a head node of said succession of enqueued nodes and a tail pointer pointing to a tail node of said succession of enqueued nodes, each of said succession of enqueued nodes having a next pointer, the next pointer of each of said succession of enqueued nodes pointing to a next node in sid succession of enqueued nodes from said head node to said tail node, said method comprising:obtaining a queue-specific number unique to said selected queue relative to said plural queues; setting the next pointer of said new node to the queue-specific number of said selected queue; determining whether a second thread has preempted said first thread in said selected queue and, if so, updating said tail pointer of said selected queue if needed; otherwise, setting said next pointer of said tail node of said selected queue to point to said new node; and setting said tail pointer of said selected queue to point to said new node if it has not been updated by said second thread during the performance of said method.