Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 10469 invoked from network); 30 Oct 2005 22:40:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Oct 2005 22:40:12 -0000 Received: (qmail 96640 invoked by uid 500); 30 Oct 2005 22:40:08 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 96621 invoked by uid 500); 30 Oct 2005 22:40:08 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 96610 invoked by uid 99); 30 Oct 2005 22:40:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Oct 2005 14:40:08 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [216.193.197.90] (HELO gs3.inmotionhosting.com) (216.193.197.90) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Oct 2005 14:40:04 -0800 Received: from c66-235-49-126.sea2.cablespeed.com ([66.235.49.126]:64019 helo=[192.168.1.100]) by gs3.inmotionhosting.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.52) id 1EWLqB-0007zp-1n for dev@httpd.apache.org; Sun, 30 Oct 2005 14:39:51 -0800 Mime-Version: 1.0 (Apple Message framework v734) In-Reply-To: <3032cfcd0510301409x6ce41a31xccc3798653a9e13@mail.gmail.com> References: <3032cfcd0510301409x6ce41a31xccc3798653a9e13@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <303FB30D-73FB-4EC0-99FD-2BF927831853@apache.org> Content-Transfer-Encoding: 7bit From: Brian Pane Subject: Re: functions registered for hooks - do they run in same process/thread? Date: Sun, 30 Oct 2005 14:40:08 -0800 To: dev@httpd.apache.org X-Mailer: Apple Mail (2.734) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gs3.inmotionhosting.com X-AntiAbuse: Original Domain - httpd.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - apache.org X-Source: X-Source-Args: X-Source-Dir: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Oct 30, 2005, at 2:09 PM, Peter Djalaliev wrote: > Hello, > > I understand that a module registers its own functions for > different hooks > in order to introduce its own functionality at different points of > a request > handling. I also understand that the module can specify if it wants > its > function to be executed first, in the middle or last, with relation > to other > modules' functions registered for the same hook. > > When these functions are actually called, do they execute in the same > process and thread (if threads are used) as the process/thread > handling the > connection? For example, if the worker MPM module is used, a single > thread > would handle a single connection. Would the mod_ssl code, for example, > execute within the thread for that connection? Strictly speaking, there's no guarantee that a request will be processed by one and only one thread. It's possible for a threaded MPM to hand off a request from one thread to another. For example, the version of the Event MPM in 2.3 can run the logger hook for a request in a different thread than the handler hook. (I think all of the MPMs in 2.0 happen to do all of the processing of a request in the same thread, but that's more an implementation detail than a design guarantee.) What currently _is_ guaranteed, even in 2.3, is that at most one thread at a time will process any given connection. And, as a corollary, at most one thread at a time will process any given request. (IMHO, this guarantee is one that we should preserve in 2.4.) Brian