next up previous contents
Next: Structure Types & Global Up: Semaphores: Implementation Previous: Semaphore Functionality   Contents

Implementation

The semaphores are implemented as structures with information for threads waiting on the semaphore & number of free resources The library also maintains a global queue to aid the kernel in finding out whether a timeout has happened. The kernel periodically executes $ sema\_timer\_handler()$. This function updates the global timeout queue removing threads from the semaphore wait queues if thier timeout has happened.

\includegraphics[scale=1.0]{semaphores.eps}


Soumyadeb Mitra 2002-08-07