Am 09.11.2017 um 06:28 schrieb Dietmar Maurer:
Files don't support non-blocking operation, they will always be flagged
as ready for read/write. This will work, but always blocks. There are
some "files" that are actually sockets or pipes for which this will in
fact work, but not for regular files.
Ah, I see. But it will work perfectly for pipes and sockets.
I saw your PipedProcess implementation https://gist.github.com/s-ludwig/8434299 and noticed that this spawns up to 4 threads, where only one would be required?
Or is thread creation really that cheap and it is not worth to special case such things?
It's generally fast enough to not be noticeable for interactive
applications, but for anything that spawns many processes this is
definitely less than ideal, especially because it also has a non-trivial
memory footprint. This is also why I didn't put this into vibe.d so far.
It should be possible to make this work without starting any additional
thread, and when this gets integrated into vibe.d, that should
definitely be the goal.