Re: relatively simple hack to lookup login-names (fwd)

From: Eric Green (egreen@cypronet.com)
Date: 12/18/95


>> > Profile those fork() calls though, its one of the slowest system
>> > calls! If your platform supports vfork() use that, but plain old
>> > fork() is a major performance hit.
>> >
>> Fork is EVIL. Our head coder has threatened to kill anyone who uses
>> it :P.
>
>Very understandable !
>
>man page:
>The new process (child process) is an EXACT COPY of the calling
>process ... (including a copy of all memory)
>
>If your MUD uses 10MB RAM or Virtual Memory you will end up running
>2 MUD's on your machine after a fork and use up to 20MB.
>This is a major problem of WWW servers although those beasts
>are just 400KB big!

Different systems will have different forking penalties.  From the Linux
fork(2) man page:

       Under  Linux,  fork  is  implemented  using  copy-on-write
       pages,  so  the  only penalty incurred by fork is the time
       and memory required to duplicate the parent's page tables,
       and to create a unique task structure for the child.

Its not all that bad for this, assuming you are execing right after the fork.

Eric

----------------------------+-----------------------------------------------
Eric Green                  |   "To Death Gate.  'Prepare ye the way.'"
egreen@cypronet.com         |                                       Lord Xar
http://www.cypronet.com/~dg |



This archive was generated by hypermail 2b30 : 12/07/00 PST