Date: Thu, 17 Aug 2000 16:03:47 -0700 (PDT) From: Doug White <dwhite@resnet.uoregon.edu> To: Kevin Mills <kmills@aventail.com> Cc: hackers@FreeBSD.ORG Subject: RE: freebsd and non-preemtive threads Message-ID: <Pine.BSF.4.21.0008171558120.73811-100000@resnet.uoregon.edu> In-Reply-To: <CCELKJNGPCOKBIFAKKGEAEEPCIAA.kmills@aventail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 dwhite@resnet.uoregon.edu | www.FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0008171558120.73811-100000>