Suggestion for std.process upgrade
Graham St Jack
Graham.StJack at internode.on.net
Mon Dec 12 16:30:39 PST 2011
On 13/12/11 09:13, Steven Schveighoffer wrote:
> On Mon, 12 Dec 2011 17:08:53 -0500, Bane
> <branimir.milosavljevic at gmail.com> wrote:
>
>> I have been playing with std.process (D2) lately, and have 2
>> suggestions and more or less tested code if somebody other than my
>> self have use for it.
>>
>> One is shell() function (not mentioned in the docs, curious), I see
>> it can be made more efficient on Windows. It executes shell command
>> and returns standard output as string. Current implementation do it
>> by piping stdout to temporary file on disk and reading that file
>> back. Using CreateProccess Windows API it can do same job 3 times
>> faster and remove need for temporary files and disk writes. I think
>> that is beneficial gain for some applications.
>>
>> Other is fork-exec implementation eg. starting a program using
>> command line and detaching it from parent, so it continues to run
>> after parent is dead. On Posix it is implemented using fork() and
>> exec() calls, on Windows using CreateProcess.
>
> There is a completely revamped version of std.process. It is being
> held up right now because DMD on windows depends on DMC for it's C
> runtime, and DMC has issues supporting pipes. I have recently opened
> a pull request for Walter to merge, I'm going to ping him about it
> right after 2.057 is released.
>
> For more info, see the docs Lars posted here:
>
> http://kyllingen.net/code/ltk/doc/process.html
>
> Once the DMC issue is fixed, you should see this improvement getting
> much more attention. It's very low hanging fruit.
>
> -Steve
I took a look at the link, and it looks very nice.
I am currently trying to port an application over from Linux to Windows
and the lack of wait(pid) is currently a blocker.
--
Graham St Jack
More information about the Digitalmars-d
mailing list