Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 9727 invoked by uid 6000); 30 Apr 1999 02:19:36 -0000 Received: (qmail 9668 invoked from network); 30 Apr 1999 02:19:17 -0000 Received: from monsoon.dial.pipex.net (HELO monsoon.mail.pipex.net) (158.43.128.69) by taz.hyperreal.org with SMTP; 30 Apr 1999 02:19:17 -0000 Received: (qmail 17671 invoked from network); 30 Apr 1999 02:19:09 -0000 Received: from useran35.uk.uudial.com (62.188.135.52) by smtp.dial.pipex.com.128.43.158.in-addr.arpa with SMTP; 30 Apr 1999 02:19:09 -0000 From: david.whitmarsh@dial.pipex.com (David Whitmarsh) To: new-httpd@apache.org Subject: [PATCH] Garbage Collection on win32 Date: Fri, 30 Apr 1999 02:23:48 GMT Organization: Sparkle Computer Co Ltd Message-ID: <3728895e.198419493@smtp.dial.pipex.com> X-Mailer: Forte Agent 1.5/32.451 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org Garbage collection didn't work on Win32 because of an attempt to open a directory as a file. This always seems to fail under windows. I re-arranged the logic to do the stat() first, then only do an open() if it isn't a directory. Also, I have added code to spawn a new thread for the garbage collection function in a manner analagous to the fork used in unix GC, incidentally renaming create_thread to ap_create_thread and exporting it from multithread.c. This works on win95 but I haven't tested it on NT or 98 (but I see no reason why it shouldn't work) and I don't know whether it would be applicable to OS/2. The garbage collection thread now uses its own global pool as it is no longer guaranteed that the request structure will be valid for the duration of the garbage collection process. =46inally, the patch includes the fix for the declspec(thread) problem on windows 95. I have changed the scope and use of the static variable "inside" to guard against new GC threads being spawned while one is still active. None of these changes should affect behaviour on platforms other than win32. The patch is made against yesterdays snapshot - apache-1.3_19990428191219.tar.gz - and so works with the should_proxy_garbage_coll() change. David ************************************ David Whitmarsh Sparkle Computer Co Ltd Sybase C C++ perl UNIX NT ************************************