Patent ID: 7353369

Claim:
A method for managing threads in a thread group, wherein each of the threads is assigned to one of a plurality of samples to be processed and when operating in a synchronized mode each of active threads simultaneously executes identical operations on a different one of the samples, one or more of the threads being allowed to diverge and execute operations on a sample not executed by the other threads and then return to synchronized operation with the other threads, the method comprising: fetching a program instruction; determining that the program instruction is a branch instruction and modifying an active mask to indicate threads that do not take the branch; upon determining that the program instruction is not an instruction whose opcode specifies a non-sequential change in a program address, then determining whether the program instruction includes a pop-synchronization bit, the pop-synchronization bit indicating that threads in the thread group have diverged since a synchronization token was pushed onto a stack; updating an active program counter, wherein the manner in which the active program counter is updated relates to whether the program instruction includes a pop-synchronization bit; and updating an active mask indicating which of the threads remain active upon determining there is the pop-synchronization bit.