Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 23167 invoked by uid 6000); 12 Dec 1997 13:25:38 -0000 Received: (qmail 23051 invoked from network); 12 Dec 1997 13:25:26 -0000 Received: from gate-isdn.ukweb.com (194.152.65.149) by taz.hyperreal.org with SMTP; 12 Dec 1997 13:25:26 -0000 Received: from ecstasy.localnet [192.168.2.4] by gate-isdn.ukweb.com with smtp (Exim 1.73 #1) id 0xgV5y-0005F3-00; Fri, 12 Dec 1997 13:25:34 +0000 Date: Fri, 12 Dec 1997 13:25:09 +0000 (GMT) From: Paul Sutton To: new-httpd@hyperreal.org Subject: confused child Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org We use "child" two mean different things in Unix and NT. This can be confusing. 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). //pcs