[Gambas-user] Starting a Process and forgetting about it

Tobias Boege taboege at ...626...
Tue Aug 13 12:15:40 CEST 2013


On Tue, 13 Aug 2013, Beno?t Minisini wrote:
> > However, I don't think this is a common enough scenario to have it
> > implemented directly in the Process object. I got by by using Shell
> > "setsid ... &". Whereas automatically killing background child processes
> > seems to be a nice addition. Thanks for your effort anyway.
> >
> > Regards,
> > Tobi
> >
> 
> I could call setsid() for the child process, but I have no syntax in the 
> EXEC/SHELL instruction for that. I will think about it...
> 

Besides the syntax, there is another thing to be aware of: If there is a
pipe from child -> parent (write -> read) and after the parent dies, the
child writes to the pipe, it will receive a SIGPIPE and die, too, if it
doesnt't catch this signal.

It means if whatever flag to enable setsid() is set, the user must carefully
think about adding For Read/Write/Input/Output.

Regards,
Tobi




More information about the User mailing list