Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 21786 invoked by uid 500); 24 May 2000 07:58:48 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 21730 invoked from network); 24 May 2000 07:58:44 -0000 From: Tim Costello Message-Id: <200005240757.RAA21817@fep8.mail.ozemail.net> To: new-httpd@apache.org CC: Subject: RE: Platform Specific MPM Design Questions Date: Wed, May 24 2000 18:57:23 GMT+1100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N On Wednesday, 24 May 2000, William A. Rowe, Jr. wrote: > http_main.c main() calls > mod_mpm_winnt ap_hook_args() calls > kernel32 StartService() calls > mod_mpm_hookservice() which will set up a vector to return back into > the return vector of the ap_hook_args() call so > we resume execution exactly where we left off. Aaaaah. I'm starting to see what you're getting at. You want http_main to contain the real main, and to do away with main_win32.c. Then, have the mpm do stuff, call the scm, then return to the end of the mpm, so main's always at the top of the call stack (instead of service_main). Right? > Recursive main() I hope won't happen. Not if I can get return vectors to > resume execution at the code step after launching the service. Any good > examples would be appreciated. [This does -not- have to be xplatform :-] I have another suggestion - what about the following for the mpm's pre-config hook: void winnt_pre_config() { if (running_as_service) { service_sync_event = CreateEvent(not_signaled); CreateThread(dispatcher_thread_proc); } ... /* all other pre-config processing */ ... if (running_as_service) { WaitForSingleObject(service_sync_event, INFINITE); SetServiceStatus(SERVICE_START_PENDING); } } int dispatcher_thread_proc() { StartServiceCtrlDispatcher(service_main); /* * blocks in above function "forever" - the thread becomes becomes the * service control dispatcher */ } void service_main() { /* save the service name somewhere if we need it */ SetEvent(service_sync_event); return; } I figure the phony ServiceMain is okay because it's unlikely that multiple (different) services will share apache's executable. I know this doesn't touch your problem of getting at the command-line - but it's another option that retains the flow of execution (and the values of main's local variables). It also might spark something better in someone else's head. Tim This message was sent through MyMail http://www.mymail.com.au