METHOD AND APPARATUS FOR IMPLEMENTING ATOMIC FIFO
First Claim
1. A computer-implemented method performed by a multi-processing system having multiple execution units capable of executing multiple threads concurrently, the method comprising:
- in a first thread of execution;
atomically merging new data with existing data of an object via an atomic instruction associated with hardware that executes the first thread; and
attempting to acquire exclusive access to the object, and if successful, enqueuing the object as a continuation element onto a queue having a list of continuation elements pending therein;
in a second thread of execution which is executed concurrently with respect to the first thread;
processing the continuation elements pending on a queue and assuming exclusive access to each continuation;
executing a function member of the continuation element using a data member of the continuation element, the data member including the merged new data; and
terminating the exclusive access to the second continuation element; and
determining whether additional data was merged by a third thread of execution restarting the process if necessary.
1 Assignment
0 Petitions
Accused Products
Abstract
Techniques for implementing an atomic FIFO queue and system for processing queue elements are described herein. According to one embodiment, in a first thread of execution, new data is atomically merged with existing data of an object via an atomic instruction associated with hardware that executes the first thread. An attempt is made to acquire ownership of the object (exclusive access). If successful, the object is enqueued on an atomic FIFO queue as a continuation element for further processing. Otherwise, another thread of execution is safely assumed to have acquired ownership and taken responsibility to enqueue the object. A second thread of execution processes the atomic FIFO queue and assumes ownership of the continuation elements. The second thread invokes a function member of the continuation element with a data member of the continuation element, the data member including the newly merged data. Other methods and apparatuses are also described.
-
Citations
22 Claims
-
1. A computer-implemented method performed by a multi-processing system having multiple execution units capable of executing multiple threads concurrently, the method comprising:
-
in a first thread of execution; atomically merging new data with existing data of an object via an atomic instruction associated with hardware that executes the first thread; and attempting to acquire exclusive access to the object, and if successful, enqueuing the object as a continuation element onto a queue having a list of continuation elements pending therein; in a second thread of execution which is executed concurrently with respect to the first thread; processing the continuation elements pending on a queue and assuming exclusive access to each continuation; executing a function member of the continuation element using a data member of the continuation element, the data member including the merged new data; and terminating the exclusive access to the second continuation element; and determining whether additional data was merged by a third thread of execution restarting the process if necessary. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A machine-readable storage medium storing instructions, which when executed by a machine, cause a machine to perform a method of a multi-processing system having multiple execution units capable of executing multiple threads concurrently, the method comprising:
-
in a first thread of execution; atomically merging new data with existing data of an object via an atomic instruction associated with hardware that executes the first thread; and attempting to acquire exclusive access to the object, and if successful, enqueuing the object as a continuation element onto a queue having a list of continuation elements pending therein; in a second thread of execution which is executed concurrently with respect to the first thread; processing the continuation elements pending on a queue and assuming exclusive access to each continuation; executing a function member of the continuation element using a data member of the continuation element, the data member including the merged new data; and terminating the exclusive access to the second continuation element; and determining whether additional data was merged by a third thread of execution restarting the process if necessary. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16)
-
-
17. A system, comprising:
-
a first execution unit to execute a first thread to atomically merge new data with existing data of an object via an atomic instruction associated with hardware that executes the first thread, to attempt to acquire exclusive access to the object, and if successful, to enqueue the object as a continuation element onto a queue having a list of continuation elements pending therein; and a second execution unit to execute a second thread concurrently with respect to the first thread to process the continuation elements pending on a queue and assuming exclusive access to each continuation, execute a function member of the continuation element using a data member of the continuation element, the data member including the merged new data, terminate the exclusive access to the second continuation element, and determine whether additional data was merged by a third thread of execution restarting the process if necessary. - View Dependent Claims (18, 19)
-
-
20. A computer-implemented method performed by a multi-processing system having multiple execution units capable of executing multiple threads concurrently, the method comprising:
-
in a first thread of execution; atomically merging new data with existing data of a first continuation element via an atomic instruction associated with hardware that executes the first thread; and enqueuing the first continuation element having merged data into a queue having a list of continuation elements pending therein; in a second thread of execution; acquiring exclusive access to a second continuation element; executing a function member of the second continuation element using a data member of the second continuation element, the data member including the merged new data; terminating the exclusive access to the second continuation element, wherein the queue comprises a hierarchical structure having a plurality of levels, including a root level and one or more lower levels, each level having a list of continuation elements, wherein the first thread is configured to process continuation elements of a lower level, and wherein the second thread is configured to process continuation elements of the root level; and in a third thread of execution; in response to a resume event of a third continuation element, determining whether the third continuation element has been suspended by another thread; acquiring exclusive access of the third continuation element; pushing the third continuation element from a current level of the queue onto a higher level of the queue, if the current level is not the root level; and terminating the exclusive access of the third continuation element, wherein the first thread, the second thread, and the third thread are executed substantially concurrently. - View Dependent Claims (21, 22)
-
Specification