Synchronization method for work distribution in a multiprocessor system
First Claim
1. In a multiprocessor system, a method for synchronizing the operations of two threads so as to execute a task with only one of the two threads, wherein one of the two threads is a main thread and wherein the one of the two threads is a child thread, comprising the steps of:
- providing first, second and third variables that are accessible by both of the threads;
initializing the first and second variables to an `open` state and the third variable to a `task not done` state, the first variable being associated with the first thread and the second variable being associated with the second thread;
with the main thread, setting up work buffers for the task until there are no further work buffers to set up;
before a first thread begins to access the task, testing the first variable to determine that it is in the `open` state and, if it is, setting the second variable to a `closed` state;
retesting the first variable with the first thread to insure that it is still in the `open` state and, if it is, accessing the task;
setting the third variable to a `task done` state; and
executing the accessed task;
whereinfor a case where the main thread is the first thread, the steps of testing, retesting, setting and executing are only performed after there are no further work buffers to be set up, and the main thread executes the task in response to determining that a child thread is not currently executing the task.
1 Assignment
0 Petitions
Accused Products
Abstract
In a multiprocessor system, such as a graphics data processing system, a method is disclosed for synchronizing the operations of two threads so as to execute a graphics data computation task with only one of the two threads. The method includes the steps of providing a set of local variables that are accessible, only through an atomic operation, by both of the threads. Before accessing a graphics data work buffer with one of the threads, testing a plurality of the local variables to ensure that the other thread has not already accessed the work buffer and, if it has not, setting one of the local variables to deny the other thread access to the work buffer. The method further includes the steps of accessing the work buffer and executing the graphics data computation task using the contents of the work buffer.
46 Citations
8 Claims
-
1. In a multiprocessor system, a method for synchronizing the operations of two threads so as to execute a task with only one of the two threads, wherein one of the two threads is a main thread and wherein the one of the two threads is a child thread, comprising the steps of:
-
providing first, second and third variables that are accessible by both of the threads; initializing the first and second variables to an `open` state and the third variable to a `task not done` state, the first variable being associated with the first thread and the second variable being associated with the second thread; with the main thread, setting up work buffers for the task until there are no further work buffers to set up; before a first thread begins to access the task, testing the first variable to determine that it is in the `open` state and, if it is, setting the second variable to a `closed` state; retesting the first variable with the first thread to insure that it is still in the `open` state and, if it is, accessing the task; setting the third variable to a `task done` state; and executing the accessed task;
whereinfor a case where the main thread is the first thread, the steps of testing, retesting, setting and executing are only performed after there are no further work buffers to be set up, and the main thread executes the task in response to determining that a child thread is not currently executing the task. - View Dependent Claims (2, 3)
-
-
4. In a data processing system, a method for synchronizing the operations of two threads so as to execute a data computation task with only one of the two threads, wherein one of the two threads is a main thread and wherein the one of the two threads is a child thread, comprising the steps of:
-
providing a set of local variables that are accessible, only through an atomic operation, by both of the threads; with the main thread, setting up data work buffers for the data computation task until there are no further data work buffers to set up; before accessing a data work buffer with one of the threads, testing a plurality of the local variables to ensure that the other thread has not already accessed the data work buffer and, if it has not, setting one of the local variables to deny the other thread access to the data work buffer; and accessing the data work buffer and executing the data computation task using the contents of the data work buffer;
whereinthe main thread executes the steps of testing, setting, accessing the data work buffer and executing only after there are no further data work buffers to be set up, and the main thread executes the data computation task in response to determining that a child thread is not currently executing the data computation task. - View Dependent Claims (5, 6)
-
-
7. A graphics data processing system, said graphics data processing system being comprised of a plurality of data processors wherein one data processor executes a first thread and a second data processor executes a second thread, wherein one of the two threads is a main thread and wherein the one of the two threads is a child thread, and further comprising:
-
memory means for storing a set of local variables that are accessible, only through an atomic operation, by both of the data processors; a plurality of work buffers for storing graphics data for individual ones of the data processors; and means for synchronizing the operations of the two data processors so as to execute a graphics data computation task with only one of the two data processors, comprising in each of said data processors, means responsive to an impending access to a graphics data work buffer by the data processor for testing a plurality of the local variables to ensure that the other data processor has not already accessed the graphics data work buffer and, if it has not, for setting one of the local variables to deny the other data processor access to the graphics data work buffer; and
means for accessing the graphics data work buffer and for executing the graphics data computation task using the contents of the graphics data work buffer;
wherein the main thread data processor sets up the graphics data work buffers until there are no further graphics data work buffers to set up, and wherein the testing, setting, accessing the graphics data work buffer and executing means of the main thread data processor operates only in response to a condition wherein there are no further graphics data work buffers to be set up, and the main thread data processor determining that a child thread data processor is not currently executing the graphics data computation task. - View Dependent Claims (8)
-
Specification