
On Wed, 01 Sep 2010 13:48:48 +0200, Ilya Sokolov <ilyasokol@gmail.com> wrote:
[...]There is not much new in the concept of async_pipe. It is just a pipe which supports async I/O. The alternative is to know what limitations each target platform has and write something like this:
#ifdef _WIN32 ctx.stdout_behavior = bp::behavior::named_pipe::create( bp::behavior::pipe::output_stream); #else ctx.stdout_behavior = bp::behavior::pipe::create( bp::behavior::pipe::output_stream); #endif
Adding another type like async_pipe could be a compromise though?
If using named pipes on Windows for sync I/O is not slower than using anonymous pipes, than there is no need for a separate type.
I think this is one question (where I don't know the answer to though). If in doubt I'd prefer to use anonymous pipes to avoid potential overhead of named pipes for synchronous I/O. It wouldn't be probably much anyway but then this is C++. :-) Another question is whether it's only us who can't imagine another use case. Maybe a developer wants to access the named pipe (the name can be returned through a parameter of the constructor and thus is available). I haven't thought about it deeply but would be careful to be more restrictive than we need to be. Boris