Blocking on multiple threads with timeout

Jonathon McKitrick jcm at FreeBSD-uk.eu.org
Sun Feb 27 11:09:03 PST 2005


I have a few threads that might need as long as a minute or more to
complete and terminate.  If they exceed an arbitrary time, they can be
canceled.

In Win32, there is a 'wait on multiple objects' call.  I'm not sure if it
blocks or spins, but it *does* take a timeout argument.

Is there a similar way with pthreads that I can use that will kill the
threads after a certain time, but without spinlocking?  After a minute of
spinning, my laptop fan kicks on, and I'd like to be a bit more reasonable
about my CPU cycle demands. :-)

Jonathon McKitrick
--
My other computer is your Windows box.





More information about the Users mailing list