Patent ID: 7917908

Claim:
In a multi-processor application system including, one or more shared resources each controlled by a unique semaphore, an ordered queue of threads having one semaphore head thread defining an eligible thread in the ordered queue of threads entitled to lock a semaphore and in which a next eligible thread in the ordered queue of threads behind the semaphore head thread becomes a new semaphore head thread when a current semaphore head thread locks the unique semaphore, wherein only the eligible semaphore head thread is eligible to acquire a unique semaphore, an ordered semaphore management subsystem comprising: a storage means associated with a requesting semaphore head thread requesting the unique semaphore and including a field for storing the unique semaphore requested, a valid field for indicating when set a locked status of the unique semaphore requested, and a pending field for indicating a priority when set that the requesting semaphore head thread is entitled to the unique semaphore requested when it becomes unlocked, wherein the pending field includes two or more bits for indicating the priority; a first logic circuit responsive to a semaphore lock request from the requesting semaphore head thread for examining the storage means and locking the unique semaphore requested if the unique semaphore requested is not locked by another thread and if the unique semaphore requested is locked by another thread providing an indication that the unique semaphore requested is locked; a second logic circuit responsive to the indication that the unique semaphore requested is locked for examining a plurality of pending fields in the storage means and setting the pending field associated with the requesting semaphore head thread if no other pending field for the unique semaphore requested is set to form a pending thread and making a next eligible thread in the ordered queue the requesting semaphore head thread when the pending field associated with the requesting semaphore head thread is set; and a third logic circuit for monitoring status of the unique semaphore requested and unlocking the unique semaphore requested for the pending thread and resetting an associated pending field when the unique semaphore requested becomes relocked.