Received: by taz.hyperreal.com (8.6.12/8.6.5) id JAA27328; Sun, 4 Aug 1996 09:27:34 -0700 Received: from arachnet.algroup.co.uk by taz.hyperreal.com (8.6.12/8.6.5) with SMTP id JAA27319; Sun, 4 Aug 1996 09:27:31 -0700 Received: from heap.ben.algroup.co.uk by arachnet.algroup.co.uk id aa17623; 4 Aug 96 17:26 BST Received: from gonzo.ben.algroup.co.uk by heap.ben.algroup.co.uk id aa20489; 4 Aug 96 16:44 BST Subject: Re: Win32 Progress Report To: new-httpd@hyperreal.com Date: Sun, 4 Aug 1996 16:39:11 +0100 (BST) From: Ben Laurie In-Reply-To: from "Alexei Kosut" at Aug 3, 96 09:16:33 pm X-Mailer: ELM [version 2.4 PL24 PGP2] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 3211 Message-ID: <9608041639.aa26249@gonzo.ben.algroup.co.uk> Sender: owner-new-httpd@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com Alexei Kosut wrote: > > On Sat, 3 Aug 1996, Ben Laurie wrote: > > > People might be interested to know that I spent some time looking at porting > > threaded Apache to Win32 today. > > Yes, they might be :) I am, at least. > > > Initial success was excellent - RST's basic smoketest ported and ran first > > time. However, things got hairier when I started to look at DNS. The basic > > problem is that Win32 just doesn't have a resolver interface. gethostbyname() > > is as low-level as you can get without writing (or stealing) the whole shebang. > > Also, non-blocking I/O is done in a very Windowsy way. > > Hmmph. Sounds like fun :) > > > Anyway, this has led me to contemplate writing instead an RSThread > > compatibility layer which translates into Win32threads. The only snag about > > this is that Win32 then gets to be the guinea-pig for preemptive threading. > > Actually, Solaris already has. It just got too complicated, so I stopped > :) Seriously... I did try to port RST's package to use POSIX threads. I > ran into some problems with DNS (nothing I couldn't solve with enough > time, I don't think), and I couldn't figure out a way, really, to > implement the concept of per-thread alarms, as rsthreads have. Of course, > I only spent a couple hours on it. So I don't know if it counts. For the record, I now have DNS working with Win32 threads. Per-thread alarms, it seems to me, are best handled by having an alarming thread to manage them. Simple enough stuff, really. Of course, I say this from the best position - not having even looked at them yet ;-) > > But I've been told by people who seem to know what they're talking about > that we really should use native threads where available. *shrug* > > > There are two possible alternatives. The first is to do things the old > > non-preemptive Win16 way - with hidden windows and Windows messages flying > > about the place. The second is to use Win32threads but only for the internal > > asynchronous stuff (so Apache still threads non-preemptively). Both of these > > avoid the guinea-pig scenario, at the cost of being crap. If you'll pardon my > > French. > > > > There's also the question of how sfio fits into all this. I'm trying to avoid > > thinking about that right now ;-) If anyone feels brave they can look into it > > for me... > > Well, if the OS has thread-safe IO, presumably, we don't need to use sfio. > Unless we want to make use of that nice stacked discipline stuff. Part of the point, for me at least, of threads was to enabled stacked disciplines to be written the right way out (that is, as coroutines). Whether sfio helps with that, I don't know! > > Of course, this is not really my area of expertise. I'll forgive you then ;-). Cheers, Ben. > > -- Alexei Kosut The Apache HTTP Server > http://www.nueva.pvt.k12.ca.us/~akosut/ http://www.apache.org/ > -- Ben Laurie Phone: +44 (181) 994 6435 Freelance Consultant and Fax: +44 (181) 994 6472 Technical Director Email: ben@algroup.co.uk A.L. Digital Ltd, URL: http://www.algroup.co.uk London, England. Apache Group member (http://www.apache.org)