Re: How to wait for multiple threads simultaneously?



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.



.



Relevant Pages

  • Re: Embedding assembler in a language
    ... It is worth noting that POSIX was created specifically for this purpose: ... a common interface that all operating systems could implement, ... The 1986 version was about Unix, ... Bytecode does not aid portability. ...
    (comp.lang.misc)
  • Re: MacOSX config file - newbie level help please!
    ... APLer wrote: ... Not POSIX compliant enough. ... The Open Group certified the current version of OS X is 100% UNIX 03 ...
    (rec.games.roguelike.nethack)
  • Re: MacOSX config file - newbie level help please!
    ... Not POSIX compliant enough. ... The Open Group certified the current version of OS X is 100% UNIX 03 ... Compiling a few programs is hardly the ...
    (rec.games.roguelike.nethack)
  • Re: How to set EOF of a file?
    ... MS-Windows is also POSIX compliant. ... Over this OS layer, there is the C standard library, including stdio, ... begin) won't work on unix. ...
    (comp.unix.programmer)
  • Re: libc and *nix
    ... First off, POSIX is a standard for unix systems for what headers, ... libraries, APIs, etc. they have. ...
    (comp.unix.programmer)