Tuesday, November 22, 2005

synchronization mechanism in linux

Linux supports the following synchronization mechanisms:

  • Critical Section A critical section is a piece of code that may be accessed only by a single thread at a time, for example a code segment that changes a shared variable.
  • Mutual Exclusion A mutual exclusion (mutex for short) is an object that restricts access to a variable or code section to a single thread at a time. Thus, you may use a mutex to protect a critical code section.
  • Semaphores A semaphore restricts access to a variable or object to a limited number of threads. For example, a semaphore may be used to ensure that three threads at most access a system's clock.

0 Comments:

Post a Comment

<< Home