Infinite loop not working DMD2
Steven Schveighoffer
schveiguy at yahoo.com
Thu Jun 2 10:29:13 PDT 2011
On Thu, 02 Jun 2011 11:43:50 -0400, Guillermo Estrada <phrzn at live.com>
wrote:
> Hi, been developing in D a lot but first time in news groups, I
> thought this might be the place.
>
> I'm trying to make a fork bomb in D (of course no fork cause target
> its windows platform) but anyway. I did one a while ago using D1 and
> Tango and all ran perfectly, I'm trying to migrate my whole dev to
> D2 and Phobos (reading Andrei's book) but this one does not work.
>
> import std.process;
>
> void main(string[] args) {
> while( true ) {
> execv(args[0], null);
> }
> }
>
> It spawns one after the other but just once, it always exits the
> father process, if u comment the execv line, program stays in the
> infinite loop as expected. any insight?
std.process is woefully unmaintained. Lars K is developing a new version,
and I am really really late getting a windows version to him so it can be
included in phobos. It includes simple methods to create a sub-process,
which should solve your issue.
I think this shall be my next "Spare time" project for D. Sorry about
this, Lars.
-Steve
More information about the Digitalmars-d-learn
mailing list