![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| pthread condition variables and mutexes? | siddaonline | UNIX for Dummies Questions & Answers | 2 | 08-30-2008 11:47 AM |
| How many semaphores? | Watto86 | UNIX for Advanced & Expert Users | 8 | 11-07-2007 10:32 PM |
| Need to execute 2 scripts, wait, execute 2 more wait, till end of file | halo98 | Shell Programming and Scripting | 1 | 08-01-2006 01:42 PM |
| Howto spawn multiple child processes and wait? | siegfried | High Level Programming | 4 | 10-16-2005 10:21 PM |
| C++ variable scope and mutexes | Corona688 | High Level Programming | 0 | 10-05-2005 10:29 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
How to wait on multiple semaphores/mutexes
I thought one used the select function to wait on multiple semaphores but according to http://opengroup.org/onlinepubs/0079...sh/select.html, the select function is only good for I/O features (like pipes and fifos).
How can I block for multiple semaphores? What if I have a mixture of things to wait on like semaphores from sem.h, semaphores from semaphore.h and mutexes? Am I out of luck? Thanks, Siegfried |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Use pthread_mutex_timedlock(), sem_trywait() (in conjunction with sleep()) functions in a cycle and continue executing when all mutexes/semaphores are blocked by your thread.
|
||||
| Google The UNIX and Linux Forums |