Thanks Alex, I am trying to download a bunch of URLs in parallel and wait until all the downloads have finished before proceeding. Calling (kill Pid 0) seems reasonable. Regards, Kashyap
On Sat, May 11, 2019 at 11:24 AM Alexander Burger <a...@software-lab.de> wrote: > Hi Kashyap, > > > How can I wait for a forked child to finish in picoLisp? > > Unless you call wait() via 'native', there is no explicit interface to this > system call. > > If you start the child via 'in', 'out', 'call' or 'pipe', the waiting is > handled > by PicoLisp internally for you. > > If you need to call 'fork', then you must wait "by hand", e.g. by calling > (kill > 0 Pid) in a loop, or check the return value of (kids). > > (if (fork) > (let Pid @ # In parent > (while (kill Pid 0) > (wait 200) ) > #{Child terminated}# ) > # In child > #{Child code}# ) > > ☺/ A!ex > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >