|
Boost : |
Subject: Re: [boost] New Version (0.4) of Boost.Application (Aspect Based) available to comments (RFC).
From: james (james_at_[hidden])
Date: 2013-11-09 06:58:45
On 08/11/2013 11:43, Renato Forti wrote:
> class selfpipe : noncopyable
> {
> protected:
> void setup() {
> pipe(fd_);
> fcntl(fd_[READ_FD], F_SETFL, fcntl(fd_[READ_FD], F_GETFL) |
> O_NONBLOCK);
> fcntl(fd_[WRITE_FD], F_SETFL, fcntl(fd_[WRITE_FD], F_GETFL) |
> O_NONBLOCK);
> }
>
> void teardown() {
> close(fd_[READ_FD];
> close(fd_[WRITE_FD];
> }
>
> public:
> int readfd() const { return fd_[READ_FD]; }
> void poke() { write(fd_[WRITE_FD], "", 1); }
>
> private:
> enum { READ_FD = 0, WRITE_FD = 1 };
> int fd_[2];
> };
How is that supposed to work in Windows? (Does it need to?)
Its sensible to expose 'something' that can be integrated to native
event loops, but the ideal choice under Windows is probably an
event, not a pipe descriptor.
I think some analysis is needed.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk