Infinite loop not working DMD2

Jonathan M Davis jmdavisProg at gmx.com
Thu Jun 2 09:09:52 PDT 2011


On 2011-06-02 08:59, Ali Çehreli wrote:
> On 06/02/2011 08:51 AM, Guillermo Estrada wrote:
> >> The exec* family of functions cause the new app to replace the
> > 
> > current process.  So after the execv, the loop doesn't exist.
> > 
> > Any way to spawn the process without killing himself?
> 
> Would std.process.system or std.process.shell work?

If they were called in spawned threads. What he really wants is fork though, I 
believe (it _is_ a _fork_ bomb after all), but I'm not sure how safe that is 
or isn't to call in D, since I don't know how that affects the state of the 
druntime. It's probably okay, since you then have two, completely separate 
processes, but I don't know. Regardless, you'd have to be calling the C fork, 
because I don't believe that druntime or Phobos provide any kind of wrapper 
for fork.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list