摘要 |
Implementing synchronization among threads in a workflow. A memory area stores a plurality of work items in a scheduler queue. The work items are associated with an activity in the workflow, and each work item is associated with a thread. A processor is configured to assign a synchronization handle to each of the work items. The synchronization handle indicates a particular shared resource to be accessed by the work items. A token value is computed for each work item based on the assigned synchronization handle and the work items in a hierarchy in the activity. The work items are sorted in a synchronization queue based on the token value associated with each work item. The processor sequentially executes each of the sorted work items in the synchronization queue to serialize the access to the particular shared resource and effects a synchronous execution of the threads associated with the work items. |