8 entry daha
  • şöyle bir örneklendirme ve açıklaması da olabiliyor:

    is the number of free identical toilet keys. example, say we have four toilets with identical locks and keys. the semaphore count - the count of keys - is set to 4 at beginning (all four toilets are free), then the count value is decremented as people are coming in. if all toilets are full, ie. there are no free keys left, the semaphore count is 0. now, when eq. one person leaves the toilet, semaphore is increased to 1 (one free key), and given to the next person in the queue.

    officially: "a semaphore restricts the number of simultaneous users of a shared resource up to a maximum number. threads can request access to the resource (decrementing the semaphore), and can signal that they have finished using the resource (incrementing the semaphore)."
    ref: symbian developer library

    http://pheattarchive.emporia.edu/…vs_ semaphore.htm
14 entry daha
hesabın var mı? giriş yap