On Thu, 17 Aug 2000, Kevin Mills wrote:

> >
> > This reminds me of coroutines or userland select- or kqueue-based
> > "threading."  Coroutines is a bit more complex but a library is
> > available.
> 
> I've seen the term 'kqueue-based threading' on this list a few times now.
> Could you explain what you mean by that?

I think I coined it. :)  It's the technique of using kqueue to multiplex
I/O.  You can create highly efficient multi-connection servers by using
kqueue (or select/poll) to dispatch work.  It works very nicely for
protocols like SMTP that have a send/response style, where you receive a
command, process it, and send back the response.  When you send or
receive, you do the read or write nonblocking and let kqueue/select/poll
tell you when it's done.

The URL I quoted in my last message is a Python implementation of
select-based threading.  We've done a somewhat trivial port of it to
kqueue and are working on a better integration module.

Doug White                    |  FreeBSD: The Power to Serve
[EMAIL PROTECTED]     |  www.FreeBSD.org



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to