The new std.process is ready for review

Jonas Drewsen jdrewsen at nospam.com
Sun Feb 24 12:36:18 PST 2013


On Sunday, 24 February 2013 at 14:44:51 UTC, Steven Schveighoffer 
wrote:
> On Sun, 24 Feb 2013 08:03:24 -0500, Jonas Drewsen 
> <jdrewsen at nospam.com> wrote:
>
>>
>> 1, What about support for nonblocking wait(). It would be very 
>> nice not to block the main thread if you really don't care 
>> about waiting for the sub process but just want to be nice and 
>> not create zombies.
>
> Non-blocking wait was brought up.  I think we can add it.  It 
> would be non-blocking wait on specific processes though, I 
> think doing a wait for *any* process is a more difficult 
> problem to solve, and is not supported in the current 
> std.process.  It may be something added later.

I saw that you have implemented this now - great!.

>> 2, What about nonblocking read/writes or support for timing 
>> out reads/writes at least. On linux you can select() on the 
>> file descriptor but that is not supported on windows.
>
> This is not an issue with std.process, but rather with File.  
> If File doesn't support non-blocking read/write, that is an 
> issue, but we should solve it for all streams, not just pipes.

Since File is just used to wrap the fd created in std.process it 
is not possible for File to make this non-blocking since windows 
doesn't have proper support for non-blocking fds that are not 
sockets e.g. files or pipes. The recommended way to communicate 
non-blocking between processes this way is to create a named pipe 
and do waitformultiple objects on that.

/Jonas


More information about the Digitalmars-d mailing list