TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Phil Crown
from: Roland Ott
date: 1995-03-02 12:36:16
subject: Re: spawn(P_NOWAIT..) / wait()???

Hello Phil!

 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 program
 PC> asynchronously in the first place.  Am I making any sense? :-)

You can sure do some useful work in your parent process, When it's
time to shut down your program, you should wait for completion of all
other "threads" of execution.

Though spawn* will simplify porting UNIX software (the main design
goal of emx) by replacing fork + exec, you're probably better off
using the OS/2 API (DosExecPgm, DosStartSession) in new programs.

If you still consider using spawn*, you should look up the manual
entries for signal() and kill().

And if you only want to run a DOS-program, why not use 'system'?

cu/2 Roland

... I program like a MAN.  I use COPY CON PROGRAM.EXE            
--- Blue Wave/Max v2.12 OS/2 [NR]
* Origin: CCWN: Leistung ueberzeugt !!! (2:246/1401)
SEEN-BY: 105/42 620/243 624/50 711/401 409 410 413 430 807 808 809 934 955
SEEN-BY: 712/407 515 628 704 713/888 800/1 7877/2809
@PATH: 246/20 1102 24/999 240/5002 5500 396/1 3615/50 105/103 42 712/515
@PATH: 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™.