Patent ID: 8359459

Claim:
A method for synchronizing multi-threaded operations in a processor, the method comprising: dividing a unit of work into a plurality of portions; assigning each of the plurality of portions to a separate thread of a group of threads; assigning a first register and a second register to the group, and storing a first bitmask in a first register and a second bitmask in a second register, wherein a given bit in the first bitmask indicates a corresponding thread of the group of threads has been assigned to execute one of said portions, and a corresponding bit in the second bitmask indicates the corresponding thread has completed execution of its assigned portion; each thread of the group of threads providing updates to the second bitmask in the second register; and determining that the unit of work has been completed in response to detecting that for each bit in the first bitmask that corresponds to a thread that is assigned a portion of the plurality of portions, a corresponding bit in the second bitmask indicates its corresponding thread has completed execution of its assigned portion of the unit of work.