Re: How to wait for multiple threads simultaneously?



chjfth@xxxxxxxxx wrote:

Hello,

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?

An even harder question, how can I wait for one thread's end and one
file descriptor(e.g STDIN_FILENO) to be readable simultaneously? -- If
either one of the two conditions becomes fulfilled, the other one must
quit its waiting status immediately as if no wait operation was
carried
out.


you should give a look to pthread_cond_create and similar POSIX functions.

--
SF

Facciamo quello per cui siamo stati addestrati, per cui siamo stati cresciuti, per cui siamo nati. Niente prigionieri, nessuna pietà. Inizio memorabile.
.



Relevant Pages

  • Re: running program remotely on different user
    ... from test in gui mode if i run ... want to run the command for user 'test' so that he can ... Facciamo quello per cui siamo stati addestrati, per cui siamo stati cresciuti, ...
    (comp.os.linux.development.apps)
  • Re: One socket - multiple ifaces
    ... struct sockaddr_in's sin_addr field (assuming you are programming in C/C++), but it's not possible to choose a subset of your ifaces. ... Facciamo quello per cui siamo stati addestrati, per cui siamo stati cresciuti, per cui siamo nati. ...
    (comp.os.linux.development.system)
  • Re: IsBadReadPtr for Linux?
    ... without using a temporary file (which arguably shouldn't be necessary ... I ended up calling msync on the appropriately page ... Facciamo quello per cui siamo stati addestrati, per cui siamo stati cresciuti, per cui siamo nati. ...
    (comp.os.linux.development.apps)
  • Re: close fd while select/poll/epoll
    ... failed to explain your case well enough to overcome the obvious opposite, ... Facciamo quello per cui siamo stati addestrati, per cui siamo stati cresciuti, per cui siamo nati. ...
    (comp.os.linux.development.system)