Re: How to wait for multiple threads simultaneously?
- From: llothar <llothar@xxxxxx>
- Date: Tue, 12 Feb 2008 03:42:41 -0800 (PST)
I'd like to ask whether Linux provides an effective way to wait for
multiple thread's end. Using pthread_join, I can only wait for one
thread at a time. Microsoft provides WaitForMultipleObject for doing
this , how about glibc or POSIX?
Unix is very broken in this area. Everything is a file descriptor
except
everything that was designed after the initial release (IPC's either
Unix V
or posix). Yes Unix guys this sucks much - you don't even have a
common
way around the sucking select. Yes i know about kqueue.
But back to the question. The best is to write a small background
thread that
does nothing else then handle thread and process termination signals.
And
build a message passing algorithm on top of this. You can use a pipe
or so
as the base mechanism for the message queue.
.
- Follow-Ups:
- Re: How to wait for multiple threads simultaneously?
- From: Rainer Weikusat
- Re: How to wait for multiple threads simultaneously?
- References:
- How to wait for multiple threads simultaneously?
- From: chjfth
- How to wait for multiple threads simultaneously?
- Prev by Date: Re: How to wait for multiple threads simultaneously?
- Next by Date: Re: How to wait for multiple threads simultaneously?
- Previous by thread: Re: How to wait for multiple threads simultaneously?
- Next by thread: Re: How to wait for multiple threads simultaneously?
- Index(es):
Relevant Pages
|