You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ben Hyde <bh...@gensym.com> on 1997/11/20 21:21:21 UTC

http_main.c

I'm starting to get my sea legs in this thing and
I'd like to ask some questions.  If you'd rather I
just go figure it out my self, that's ok, just ignore
me.

I've a rant I like to inflict on people about how clean
code tends to get abused until it becomes sufficently
obscure to defend it's self.  http_main.c is a fine
example of that.

I'm bemused by HAVE_MMAP being redefined in there for
WIN32 but in point of fact it never calls MMAP.  Does
Win32 not define USE_MMAP_FILES because: (a) it would be
slower, (b) the code is yet to be written, (c)
none of the above.

Can somebody enumerate the dimensions of the current
process models in Apache.  It seems to be something
like this:
  Scoreboard
    - In file
    - In SharedMemory between processes
    - In SharedMemory between threads
  Process and thread
    - One process
    - One process as master, N process as Servers
    - N processes, 1 process as Server (using threads)
  "Service"
    - Stand alone run by user.
    - Managed by inet
    - Managed by Window's Services

  - ben h

Re: http_main.c

Posted by Dean Gaudet <dg...@arctic.org>.

On Thu, 20 Nov 1997, Marc Slemko wrote:

> Because Dean wrote the code and he hates NT?  <g>  Well, more like doesn't
> use NT to test on, but...

It's more like I hate arbitrary changes to programming semantics that gain
nothing.  The only thing that NT has which I "lust" after is completion
ports.  You can do the same in posix, only nobody has implemented all the
requisite specs (and I have to dig through several months old email to
figure out how to do it in posix again). 

> A lot of the HAVE_MMAP should be replaced by FOOBAR_SHARED or something
> which indicates that we don't care how it is accessed, only that it is
> shared somehow between connections.

Right, HAVE_MMAP is misnamed.

Dean


Re: http_main.c

Posted by Marc Slemko <ma...@worldgate.com>.
On Thu, 20 Nov 1997, Ben Hyde wrote:

> 
> I'm starting to get my sea legs in this thing and
> I'd like to ask some questions.  If you'd rather I
> just go figure it out my self, that's ok, just ignore
> me.
> 
> I've a rant I like to inflict on people about how clean
> code tends to get abused until it becomes sufficently
> obscure to defend it's self.  http_main.c is a fine
> example of that.
> 
> I'm bemused by HAVE_MMAP being redefined in there for
> WIN32 but in point of fact it never calls MMAP.  Does
> Win32 not define USE_MMAP_FILES because: (a) it would be
> slower, (b) the code is yet to be written, (c)
> none of the above.

Because Dean wrote the code and he hates NT?  <g>  Well, more like doesn't
use NT to test on, but...

A lot of the HAVE_MMAP should be replaced by FOOBAR_SHARED or something
which indicates that we don't care how it is accessed, only that it is
shared somehow between connections.

Does NT have a plain mmap() call?  I thought it only had this ugly thing
that MS touted as a great new feature that only NT has even though it does
the same thing.

> 
> Can somebody enumerate the dimensions of the current
> process models in Apache.  It seems to be something
> like this:
>   Scoreboard
>     - In file
>     - In SharedMemory between processes
>     - In SharedMemory between threads
>   Process and thread
>     - One process
>     - One process as master, N process as Servers
>     - N processes, 1 process as Server (using threads)
>   "Service"
>     - Stand alone run by user.
>     - Managed by inet
>     - Managed by Window's Services

Essentially correct I think, however you have to realize that a lot of the
NT stuff isn't well thought out yet, should be abstracted more to be
usable with Unix threads, and doesn't entirely fit in to the current way
Apache is.

Originally, there was going to be no NT support until 2.0.  Then along
came this nearly-working NT port, so people wanted "a quick 1.3 with basic
NT support".  All the abstraction and making it actually make sense is
supposedly for 2.0.


Re: http_main.c

Posted by Dean Gaudet <dg...@arctic.org>.

On Thu, 20 Nov 1997, Ben Hyde wrote:

> I've a rant I like to inflict on people about how clean
> code tends to get abused until it becomes sufficently
> obscure to defend it's self.  http_main.c is a fine
> example of that.

http_main cleanup is at the top of my 2.0 priority list.  The merge of the
WIN32 stuff has pushed http_main beyond readable.

> I'm bemused by HAVE_MMAP being redefined in there for
> WIN32 but in point of fact it never calls MMAP.  Does
> Win32 not define USE_MMAP_FILES because: (a) it would be
> slower, (b) the code is yet to be written, (c)
> none of the above.

I've no idea why other ports abuse HAVE_MMAP ... and "HAVE_MMAP" is a
complete misnomer for what it means... it really means "use mmap to
implement multi-process shared memory".

USE_MMAP_FILES on the other hand means use mmap() to speed up static file
serving in the default_handler.

I'm not aware of mmap()'s existence under WIN32... and wouldn't trust it
anyhow :)  I believe the way to get the similar performance benefit under
win32 is to use the CopyFile syscall.  Or something like that.

> Can somebody enumerate the dimensions of the current
> process models in Apache.  It seems to be something
> like this:
>   Scoreboard
>     - In file
>     - In SharedMemory between processes

right, with four choices: mmap(), shmget(), OS/2, QNX

>     - In SharedMemory between threads

right, with one choice: WIN32

>   Process and thread
>     - One process

We don't have any port that currently is in this model (unless you
consider "inetd mode" and "-X" ... which I don't).

>     - One process as master, N process as Servers

Unix, OS/2 both use this model. 

>     - N processes, 1 process as Server (using threads)

I've never understood why the NT port spawns multiple processes.  As far
as I can tell only one of them does anything. 

>   "Service"
>     - Stand alone run by user.
>     - Managed by inet

bleh. 

>     - Managed by Window's Services

Dean