www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6846] New: std.concurrency and fork/execv

http://d.puremagic.com/issues/show_bug.cgi?id=6846

           Summary: std.concurrency and fork/execv
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: jonathansternberg gmail.com



14:22:30 PDT ---
Created an attachment (id=1042)
example code from description

Attached is a sample program that I believe should work, but doesn't. The
program is a simple command runner.

It runs a maximum of 4 processes at once and each process is just "echo
<number>". The command runner uses "spawn" to create a new thread. This thread
then immediately forks and calls execv in the child. The parent then waits on
the newly created process. When it finishes, it sends it's tid and the exit
status of the command.

When run, sometimes a thread will seem to stall on the execv call. It seems
that the fork happened successfully, but a quick check with "ps" will reveal
that two processes named "test" exist (the forked one should have been
replaced).

The program then has no way to continue by itself. The only way to make it
continue is to call "kill" on the newly created processes.

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