
2013/11/8 Renato Forti
The user need use 'select' to use this aspect? How user will use it? (on final application code)
The aspect exposes a raw file descriptor in it's public interface selfpipe::readfd() and this descriptor can be passed into some I/O processing library. For example, one can assign native file descriptor to boost::asio::posix::stream_descriptor to use selfpipe with boost::asio. Also one can add this file descriptor to libevent's set of monitored descriptors. And of course, this file descriptor can be passed into direct select/poll calls. selfpipe::poke() interface can be called both explicitly and implicitly. In must be called implicitly on app's termination to allow I/O threads terminate gracefully. Explicit call may be useful when handling non-termination signals. For instance, configuration reload without restarting application is often done using user signals. Switching database backend without dropping active connections is a good aim, isn't it? :) We have something like that in Windows side? AFAIK, no. Nevertheless, I think even POSIX-only selfpipe aspect will be useful. -- Regards, Stas.