[Issue 11282] std.process: add capability for two-way inter-process communication without deadlock

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 11 15:54:29 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11282


Vladimir Panteleev <thecybershadow at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybershadow at gmail.com


--- Comment #10 from Vladimir Panteleev <thecybershadow at gmail.com> 2014-02-12 01:54:24 EET ---
How about the following design:

void runPipes(
    InputRange ir1, File if1,
    InputRange ir2, File if2,
    ...
    File of1, OutputRange or1,
    File of2, OutputRange or2,
    ...
);

This function will take chunks from the input ranges, and asynchronously feed
them in the input Files, while at the same time taking any data available to be
read from the output Files and sending them to the respective OutputRanges. The
function exits when all input ranges are empty, and when the output Files are
at eof or closed.

On POSIX, this function can use select(). On Windows, I think it's possible to
accomplish this using overlapped I/O. Worst case scenario, we can always fall
back to threads.

Perhaps someone can suggest a better function signature.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list