Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

53. POSIX Semaphores > Named Semaphores

Named Semaphores

To work with a named semaphore, we employ the following functions:

  • The sem_open() function opens or creates a semaphore, initializes the semaphore if it is created by the call, and returns a handle for use in later calls.

  • The sem_post(sem) and sem_wait(sem) functions respectively increment and decrement a semaphore’s value.

  • The sem_getvalue() function retrieves a semaphore’s current value.

  • The sem_close() function removes the calling process’s association with a semaphore that it previously opened.

  • The sem_unlink() function removes a semaphore name and marks the semaphore for deletion when all processes have closed it.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint