Patent ID: 8850436

Claim:
A computer-implemented method for synchronizing divergent executing threads, the method comprising: receiving a plurality of instructions that includes at least one set-synchronization instruction that references a synchronization point within the plurality of instructions and at least one instruction that includes a synchronization command; determining an active mask that indicates which threads in a plurality of threads are active and which threads in the plurality of threads are disabled; for each instruction included in the plurality of instructions, transmitting the instruction to each of the active threads included in the plurality of threads; when an instruction included in the plurality of instructions is a set-synchronization instruction that references a synchronization point within the plurality of instructions, then pushing onto a stack a synchronization token, the active mask and the synchronization point; and when an instruction included in the plurality of instructions is a predicated instruction that includes a synchronization command, then monitoring each active thread that executes the predicated instruction to determine when the active mask has been updated to indicate that each active thread, after executing the predicated instruction, has been disabled.