httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Sutton <>
Subject confused child
Date Fri, 12 Dec 1997 13:25:09 GMT
We use "child" two mean different things in Unix and NT. This can be

Under unix, the "child" is a separate process which gets connections and
gets requests from each connection. It has an initialisation and
close-down API phase.

Under NT, "child" could (and does) mean two things: the whole process
which handles connections and requests (and has initialisation and
close-down phases), AND the thread within this process which handles
requests on a connection. 

For example, under Unix, the init_child() phase is called at the start and
end of child_main(), which corresponds to the lifetime of a process. But
under NT, child_main() has nothing to do with processes -- it corresponds
to the lifetime of a _thread_. 

So the term child in child_main() and child_sub_main() (on NT) is invalid
and should be changed. The question is, to what? "thread" would seem
logical, except that there is actually another thread - the one which
loops around worker_main(). The normal NT terminology would be to call the
threads which handle the per-request work "workers()" and the thread which
controls them the "master". Unfortunately the current NT code callers the
controling thread "worker" and the parent process "master". I find this
all too confusing and non-extensible.

So I'd propose we use the following terminology:

  parent   -- the parent process, which looks after other processes
              (effect: rename master_main() to parent_main())

  master   -- the "special" thread which looks after the threads
              doing the real work (effect: rename worker_main()
              to master_main())

  worker   -- a thread which actually does the request processing
              (effect: rename child_*_main() to worker_*_main(),
              use pworker pool instead of pchild)

  child    -- the name for sub-processes of the parent (that is, the
              combination of master and worker threads). This
              corresponds to the init_child API phase. 

This renaming should only occur in the NT code (at the moment). It allows
us to extend Apache in the future without getting ourselves even more
confused (unless it is only me who is confused by the terminology at the
moment, of course). 


View raw message