Subject: Re: event-driven programming (was Re: Archie-Clients )
To: Bakul Shah <bakul@netcom.com>
From: Perry E. Metzger <perry@imsi.com>
List: current-users
Date: 01/29/1995 09:43:10
Bakul Shah says:
> But by using callback style programming won't you also be
> using a single threaded implementation?

Yes, but that eliminates all critical sections and makes the code
about an order of magnitude easier to write. Also, remember that
typically we only have one processor anyway...

> Since Unix does not provide async. io (you can't have multiple
> outstanding io requests from a single process), you will make
> everyone wait in a single queue.

By using select() however, you always assure that you only do I/O when
needed. In particular, the code I've been working with/writing never,
ever blocks -- period.

> If you maintain per user contexts, you will have to play
> some seteuid games.

Only if your server needs multiple priv. levels. Most anon. ftp sites
do virtually nothing but anonymous ftp -- you might as well have an
unprived, chrooted ftp daemon and get some extra security that way. If
people want "normal" ftp they do it some other way.

I'm ending the discussion of this on current since its drifted fully
away from NetBSD.

Perry