Patent ID: 8239867

Claim:
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 first queue having a list of continuation elements pending therein, the first queue being associated with a first priority, wherein the first queue is one of a plurality of queues, each queue being associated with a different priority and containing therein a plurality of continuation elements pending to be processed, and wherein the plurality of queues are processed by a plurality of threads executed independently with each other; in a second thread of execution which is executed independently with respect to the first thread: for each of the continuation elements of the first queue, attempting to acquire an exclusive access of the continuation element, if the exclusive access has been acquired successfully, dequeuing the continuation element from the first queue, enqueuing the continuation element into a second of the plurality of queues, wherein the second queue is associated with a second priority that is higher than the first priority, and releasing the exclusive access of the continuation element thereafter; in a third thread of execution which is executed independently with respect to the first thread and second thread: for each of a plurality of continuation elements in the second queue, attempting to acquire exclusive access to each continuation element, if the exclusive access of the continuation element has been successfully acquired, executing a function member of the continuation element using a data member of the continuation element, terminating the exclusive access to the continuation element after the execution, and determining whether additional data was merged by a fourth thread of execution and restarting the process of the continuation elements pending in the second queue if there is additional data merged by the fourth thread.