Re: Details on delivering and managing application

From: John Thingstad (john.thingstad_at_chello.no)
Date: 02/03/05


Date: Thu, 03 Feb 2005 19:40:33 +0100

On Thu, 03 Feb 2005 15:47:29 GMT, Wade Humeniuk
<whumeniu+anti+spam@telus.net> wrote:

> John Thingstad wrote:
>
>> It seems some peaple forget how expensive spawning new proceses is
>> compared to
>> lightweight threading. (share process and memory.)
>>
>
> How many microseconds does it take? But seriously I am tainted
> by past memories of the first releases of Solaris where we found
> forking processes was much faster than threads. I am
> also pretty sure that in some OS models there are things called
> light-weight processes that are used to implement processes and
> threads. My memory is very fuzzy though, and who cares these
> days? throw another Gig of memory in the sucker and add 4 more
> processors.
>
> Wade

Depends on your system. Unixes have a relatively quick context switch.
Still sharing data is much more difficult. And remember fork actually
copies the process before exec overwrites it. So starting the
multi-processing is much slower. (I think there is a kludge that get's
around this but I forget the details.) This matters if you are forking
a new process for each web request.
Under windows process overhead is much higher so if you want to
port the code to Windows you are in for a nasty surprise.
(However there is OS thread support which is rather fast.)
The first version of Apache for windows tried spawning (a windows term)
a new process for each request. This works well under Unix but
the performance under Windows was unacceptable.
The newer Apache 2 uses a threading pool and is much faster.

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


Relevant Pages

  • Re: apple mail as a usenet reader?
    ... handling of threading- for example, if you set it for threading ... e-mails it opens each e-mail in a separate window simultaneously. ... own windows rather than viewing them in the message pane below the ...
    (comp.sys.mac.system)
  • Re: user interface fails under UNIX (but works with Windows!)
    ... > A program I am writing, called TimeSleuth and available from ... > same program, however, works when run in Windows. ... Threading is one of the few areas which works ...
    (comp.lang.java.help)
  • Re: Rocket J. Squirrel-- repair registry
    ... I did answer a question about how to reinstall Windows, ... Chkdsk checks your hard disk for logical errors (misconfigurations of the ... file system) and for physical problems on the surface of your hard disk. ... Threading is easy to do: Just use the reply function of your newsreader and ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Can Somebody please explain
    ... Near the bottom it's got some bits about Windows Forms and threading. ... you're receiving callbacks then you'll run into problems displaying stuff - ... I am not able to display any of the messages on ...
    (microsoft.public.dotnet.general)