Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Feb 2005 19:08:42 +0000
From:      Jonathon McKitrick <jcm@FreeBSD-uk.eu.org>
To:        freebsd-questions@freebsd.org
Subject:   Blocking on multiple threads with timeout
Message-ID:  <20050227190842.GC34795@dogma.freebsd-uk.eu.org>

next in thread | raw e-mail | index | archive | help

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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050227190842.GC34795>