TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Phil Crown
from: Andrew Clegg
date: 1995-02-28 07:43:36
subject: spawn(P_NOWAIT..) / wait()???

Hi, Phil.

-=> Phil Crown spaketh unto All <=-

 PC> If I have to wait() after spawning a P_NOWAIT or P_SESSION program
 PC> (DOS in my case), then that defeats the purpose of running the
 PC> program asynchronously in the first place.  Am I making any sense?

Perfect sense -- it seems like a valid point.

 PC> So, my problem is, what good is it to use spawn*(P_NOWAIT ...) if I
 PC> have to wait() for the return code to avoid filling up memory?

Idea -- start a thread to wait() for the child process to terminate while
your main thread gets on with business.

Andrew.

/* 2:440/4.10{at}fidonet.org 81:444/1.10{at}os2net.org 102:440/5.10{at}lifnet.org
   abc{at}warpfive.demon.co.uk   Stig{at}IRC   Andrew.Clegg{at}donor2.demon.co.uk */

--- LoraBBS-OS/2 v2.35 (Eval.)
* Origin: Ten Ground And Down, Guildford UK (2:440/4.10)
SEEN-BY: 105/42 620/243 624/50 711/401 409 410 413 430 807 808 809 934 942
SEEN-BY: 711/955 712/407 515 628 704 713/888 800/1 7877/2809
@PATH: 440/4 141/209 270/101 396/1 3615/50 105/103 42 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.