Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17

Thread: Whats a Semaphores?

  1. #16
    Registered User
    Join Date
    Nov 2002
    Posts
    115

    Semaphores and mutexes

    Mutexes are used to restrict access by multiple threads to a single resource. Mutexes are mutual-exclusive locks. If one thread owns the lock, then another thread must wait until the lock is released.

    Semaphores are more of a funnel gate which allows up to X number of threads to access a shared resource before blocking access.

    Semaphores start out with a maximum lock count. When a thread locks the semaphore this lock count is reduced until it reaches zero. When no more locks are available and a thread attempts to obtain one, that thread is blocked until one of the other threads releases its lock.

    Naturally a semaphore with a max lock count of 1 is considered a mutex.

    Maggotboy

  2. #17
    Registered User
    Join Date
    Mar 2002
    Posts
    139
    That's a good explination.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

You may post new threads
You may post replies
You may post attachments
You may edit your posts
HTML code is Off
vB code is On
Smilies are On
[IMG] code is On