KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to port a project (from linux) that uses Semaphores to Mac OS X however some of the posix semaphores are not implemented on Mac OS X The one that I hit in this port is sem_timedwait() I don't know much about semaphores but from the man pages sem_wait() seems to be close to sem_timedwait and it is implemented From the man pages sem_timedwait() function shall lock the semaphore referenced by sem as in the sem_wait() function. However, if the semaphore cannot be locked without waiting for another process or thread to unlock the semaphore by performing a sem_post() function, this wait shall be ter- minated when the specified timeout expires From my limited understanding of how semphores work I can see that sem_timedwait() is safer, but I still should be able to use sem_wait() Is this correct? If not what other alternatives do I have... Thanks
Tags (comma-separated)
Save Edits
Cancel