[Haskell-cafe] When is waitForProcess not necessary?

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Thu Aug 2 23:57:51 EDT 2007


On Aug 2, 2007, at 23:52 , Dave Bayer wrote:

> If one is calling runInteractiveCommand for a "sure-thing"  
> returning a small
> amount of output (say, "ls" for a modest directory"), is it  
> necessary to call
> waitForProcess?

Most operating systems only let you have a small number of  
outstanding child processes; once you hit it, you'll need to wait()  
(aka waitForProcess) to reap the dead children before you can launch  
any more.

If you're only doing it once, you can ignore waitForProcess and let  
the OS's process exit stuff reap the child for you --- but I suggest  
documenting that you've done this, in case you later change the  
program to run more children and they start failing with "Too many  
processes".

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Haskell-Cafe mailing list