Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: (qmail 1056 invoked from network); 27 Jul 2009 19:38:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Jul 2009 19:38:18 -0000 Received: (qmail 84304 invoked by uid 500); 27 Jul 2009 19:39:23 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 84254 invoked by uid 500); 27 Jul 2009 19:39:23 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 84244 invoked by uid 99); 27 Jul 2009 19:39:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jul 2009 19:39:23 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jul 2009 19:39:12 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MVW27-0003K9-G0 for modules-dev@httpd.apache.org; Mon, 27 Jul 2009 12:38:51 -0700 Message-ID: <24686966.post@talk.nabble.com> Date: Mon, 27 Jul 2009 12:38:51 -0700 (PDT) From: ricardo13 To: modules-dev@httpd.apache.org Subject: Re: process initialisation in prefork-MPM In-Reply-To: <4A6DFD64.6040203@joe-lewis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: ricardoogrande@gmail.com References: <6456355d0812220443g3e0e830amf0daaeeba8fa3cf5@mail.gmail.com> <20170a030812220448t52884d50pe11bdb2d3b986ec6@mail.gmail.com> <24686243.post@talk.nabble.com> <4A6DF92E.8060002@joe-lewis.com> <24686596.post@talk.nabble.com> <4A6DFD64.6040203@joe-lewis.com> X-Virus-Checked: Checked by ClamAV on apache.org hi, For example, That's right ?? #include static int global_variable; static int init_child(request *r) { printf("HEllo World"); } static void register_hooks(apr_pool_t *pool) { ap_hook_child_init(init_child, NULL, NULL, APR_HOOK_MIDDLE); } /* the main config structure */ module AP_MODULE_DECLARE_DATA teste_module = { STANDARD20_MODULE_STUFF, NULL, /* create per-dir config structures */ NULL, /* merge per-dir config structures */ NULL, /* create per-server config structures */ NULL, /* merge per-server config structures */ NULL, /* table of config file commands */ register_hooks /* register hooks */ }; I was using post_config, but now I changes for child_init. THank you Ricardo Joe Lewis-2 wrote: > > ricardo13 wrote: >> HI, >> >> Sorry, but I'm using Worker MPM. >> How do I declare variable using Worker MPM ? >> >> >> Thank you >> Ricardo >> > > I always suggest the same method, regardless of the MPM, for > configuration options. If you absolutely don't want to use shared memory > and you use the worker MPM (threaded), you should be able to declare a > regular variable with your programming language of choice as static > variable, and don't reset it on a post_config unless it is only the > first time post_config is being run (otherwise, as a thread is killed > and started, it could reset your variable). > > -- > Joe Lewis > Chief Nerd SILVERHAWK (801) 660-1900 > > ------------------------------------------------------------------------ > /An army is stengthened by labor and enervated by idleness. > --Vegetius, A.D. 4th Century/ > > -- View this message in context: http://www.nabble.com/process-initialisation-in-prefork-MPM-tp21127165p24686966.html Sent from the Apache HTTP Server - Module Writers mailing list archive at Nabble.com.