1. A method for execution in a processor having a plurality of threads executing thereon, the method comprising: with processes executed by the processor, creating a barrier comprising a counter, a semaphore list identifying a plurality of semaphores, and at least one mutual exclusion (mutex) lock; for each thread using the barrier, determining whether that thread is the last to arrive; for each thread that is not the last to arrive at the barrier, causing each thread to wait on an independent semaphore and modifying the counter to have a value indicating a number of threads that have or have not entered the barrier; and for the last thread to arrive at the barrier, with the processes executed by the processor, causing each waiting thread to resume execution substantially concurrently by setting a value of the semaphore associated with each one of the waiting threads to a value that will cause the waiting threads to continue execution.