Announcement

Collapse
No announcement yet.

CreateSemaphore() - but first, what is a semaphore? :)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CreateSemaphore() - but first, what is a semaphore? :)

    Ive been searching with google.com and MSDN for a very long time now and Im more confused now than ever before
    Can somebody please explain to me what a "semaphore" or "semaphore file" is, how it differs to mutexes and/or normal files, and why you would use a semaphore?
    Thanks!


    ------------------
    -

  • #2
    WIN32.HLP, section "Semaphore Objects" should help you here...

    The 1st paragraph:
    A semaphore object is a synchronization object that maintains a count between zero and a specified maximum value. The count is decremented each time a thread completes a wait for the semaphore object and incremented each time a thread releases the semaphore. When the count reaches zero, no more threads can successfully wait for the semaphore object state to become signaled. The state of a semaphore is set to signaled when its count is greater than zero, and nonsignaled when its count is zero.
    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment

    Working...
    X