RAA - semaphore

semaphore / 1.2

Short description: Semaphore
Category: Library/thread
Status: alpha
Created: 2003-03-18 15:34:13 GMT
Last update: 2003-03-18 15:34:11 GMT
Owner: fukumoto (Projects of this owner)
Homepage: http://www.imasy.or.jp/~fukumoto/ruby/
Download: http://www.imasy.or.jp/~fukumoto/ruby/semaphore.rb
License: Ruby's
Dependency:
Required by: pipe/1.14
Description:

CountingSemaphore implements the counting semaphore, a classical inter-thread synchronization primitive.
It can be used as mutual exclusion, just like Ruby's standard library Mutex. Difference is Mutex implementation has busy loop so that it does not guarantee fairness, whereas Semaphore has strict ordered fairness.
Note that since Ruby's thread context switch is heavy, the strict ordering may not be desirable for some applications, due to increased context switch.

Edit this project (for project owner)

back to RAA top