|
Boost : |
Subject: Re: [boost] Subject: Formal Review of Proposed Boost.Process library starts tomorrow
From: Oliver Kowalke (k-oli_at_[hidden])
Date: 2011-02-10 10:27:39
Am 10.02.2011 15:03, schrieb Artyom:
> Probably it would be ok to provide some parameter
> on how to wait asynchronously:
>
> typedef enum {
> wait_default, // using thread+waitpid per-process on POSIX OS
> wait_using_sigaction, // install signal handler
> wait_using_sigwaitinfo, // install signal handler
> wait_polling, // poll all waiting pids for end, when
> // requested - for example by user's signal
> // handler
> } wait_method_type;
>
>
>
> void async_wait(pid ,method_type m = wait_default)
> #ifdef BOOST_POSIX
> void poll_handlers(); // check if child completed
> // called by user when receives sigchld
> endif
I believe this won't work because:
On POSIX the interaction of signal-handlers and threads is not defined
(it is not defined which thread gets the signal delivered).
The recommended solution is to block the signals for all threads and
declare a special thread which blocks in sigwait() for the desired signals.
Oliver
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk