httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject Re: Win32 Progress Report
Date Sun, 04 Aug 1996 15:39:11 GMT
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 <akosut@organic.com>            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)

Mime
View raw message