Subject: Re: [boost] [process] Arguments and Context concepts
From: Boris Schaeling (boris_at_[hidden])
Date: 2011-01-23 09:32:46
On Fri, 21 Jan 2011 08:21:56 +0100, vicente.botet
> [...]Could you document the requirments i nthe reference section?
Ok, I can try. I'm afraid I have to copy&paste the documentation of the
context class. :-)
> [...]Then you could pass Context by cont& without any change on user
> code. You could commeback to pass by value if you need to modify it.
I agree and will change it.
>> Well, you might not have access to the source code for example and can't
>> make the child process change the working directory.
> This is too specific to be included in a Process library.
I find this a very subjective argument. If we leave everything out someone
finds too specific there is probably nothing left. :-)
>> A more important
>> reason is though that I'd describe Boost.Process as a library trying to
>> support as many high-level cross-platform concepts as possible. I guess
>> that's the current goal after we gave up other ideas like trying to
>> support as many platform-specific features as possible (that was when we
>> had POSIX and Windows classes which could have grown endlessly and would
>> still never have been complete; now we have extension points to provide
>> the flexibility of using platform-specific features).
> I don't find the answer to my question here.
The answer is that Boost.Process tries to support high-level features
which can be supported on all platforms. This is my attempt to make
decision making on what should be included in the library less subjective.
For example I got a request to make it possible to pass the WNOHANG
parameter to boost::process::wait() on POSIX systems to make the function
non-blocking. I rejected the request on the ground that the WNOHANG
parameter is not cross-platform. If we support this in the library users
will have to use preprocessor macros. But then they can simply call system
functions directly and don't need to use Boost.Process at all. While
WNOHANG is too platform-specific the idea of making boost::process::wait()
non-blocking should work on all platforms though. It won't be WNOHANG but
something else (like for example a boolean parameter) to indicate that
boost::process::wait() should not block.
> [...]The same interface arguments applies to the Context concept
> independently of whether you use an essence argument. If you require a
> more high level interface for the Context concept, you will be able to
> implement it as efficiente as posible on specific platforms. The current
> concept behind the Context parameter has a user interface that is not
> enough abstract. The use of specific fields depending on std::string
> forbids any possible optimisation.
Can you show me some sample code which you think will allow us to benefit
from the abstraction you talk about? I agree that the context class is not
very abstract. But with only five member variables it's rather simple and
immediately usable for anyone. I'm a bit worried that abstraction makes
something that simple unnecessarily complicated?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk