*BSD News Article 79910


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!nntp.coast.net!howland.erols.net!news.mathworks.com!fu-berlin.de!informatik.tu-muenchen.de!Germany.EU.net!Dortmund.Germany.EU.net!interface-business.de!usenet
From: j@ida.interface-business.de (J Wunsch)
Newsgroups: comp.unix.bsd.misc
Subject: Re: Programming Ques. - Fork and Wait
Date: 4 Oct 1996 17:03:58 GMT
Organization: interface business GmbH, Dresden
Lines: 41
Message-ID: <533g1u$kc7@innocence.interface-business.de>
References: <532p4u$al0@cssun.cs.usm.my>
Reply-To: joerg_wunsch@interface-business.de (Joerg Wunsch)
NNTP-Posting-Host: ida.interface-business.de
X-Newsreader: knews 0.9.6
X-Phone: +49-351-31809-14
X-Fax: +49-351-3361187
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E

cyfok@network4.cs.usm.my (Chee-Youn Fok) wrote:

>   Sorry, it's programming question again. Currently I am writing a
> program which needs to use Fork and Wait function in linux to test
> how many child proseses can Unix handels in parallel.

That's basically the ``fork trap''.  You can shoot quite a bunch of
Unix systems with it.

Systems that can handle it will simply impose a limit on the maximal
number of processes per user, and try to not allow forking if this
number has been exceeded.  Thus, you can already answer your question
without programming by simply asking `limit' in the csh:

cputime         unlimited
filesize        unlimited
datasize        65536 kbytes
stacksize       8192 kbytes
coredumpsize    unlimited
memoryuse       30316 kbytes
descriptors     64 
memorylocked    10106 kbytes
maxproc         200 

The last number is what you are looking for.

If you don't believe it, try

#!/bin/sh
$0 &
exec $0

But _don't_ do this on any public machine!

fork() performance is something where Unices have been typically
trimmed for.  So your question is basically a moot point.

-- 
J"org Wunsch					       Unix support engineer
joerg_wunsch@interface-business.de       http://www.interface-business.de/~j