CPC G06F 9/522 (2013.01) [G06F 9/485 (2013.01); G06F 11/3024 (2013.01); G06F 11/3058 (2013.01); G06F 11/3495 (2013.01)] | 17 Claims |
1. A method for scheduling on an accelerated processing device (“APD”), the method comprising:
detecting execution of a wait instruction by each workgroup of a plurality of workgroups, wherein the wait instruction causes each workgroup of the plurality of workgroups to be in a waiting state, wherein the wait instruction executed by each workgroup of the plurality of workgroups specifies a condition variable and a condition to be met for the condition variable, wherein the condition variable and the condition of the wait instruction are the same for each workgroup;
monitoring the condition variable to detect when the condition is met;
in response to the condition being met as a result of only a single update to the condition variable after the wait instruction is executed by any workgroup of the plurality of workgroups, updating an estimated time of completion of a respective critical section associated with a synchronization primitive associated with the condition variable to completion of the critical section when the condition is met, and detecting that the plurality of workgroups is part of a high contention scenario indicating a mutual exclusion synchronization primitive;
while each workgroup of the plurality of workgroups is in the waiting state, waking up only a single workgroup of the plurality of the workgroups in response to the condition being met and in response to the plurality of workgroups being part of the high contention scenario indicating the mutual exclusion synchronization primitive; and
scheduling a second set including more than one workgroup to be woken up after the updated estimated time.
|