From owner-freebsd-hackers Thu Aug 17 19:20:35 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (Postfix) with ESMTP id 6200737B7CE for ; Thu, 17 Aug 2000 19:19:57 -0700 (PDT) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.9.3/8.9.3) with ESMTP id TAA28454 for ; Thu, 17 Aug 2000 19:19:53 -0700 (PDT) (envelope-from jdp@polstra.com) From: John Polstra Received: (from jdp@localhost) by vashon.polstra.com (8.9.3/8.9.1) id TAA09529; Thu, 17 Aug 2000 19:19:52 -0700 (PDT) (envelope-from jdp@polstra.com) Date: Thu, 17 Aug 2000 19:19:52 -0700 (PDT) Message-Id: <200008180219.TAA09529@vashon.polstra.com> To: hackers@freebsd.org Reply-To: hackers@freebsd.org Subject: Re: freebsd and non-preemtive threads In-Reply-To: References: Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In article , Doug White wrote: > On Mon, 14 Aug 2000, Jonas Bulow wrote: > > > I'm trying to build a preforked and threaded server. When it comes to > > the threading part it seems that non-preemtive threads have a lot of > > benefits if the server is a statefull-server. > > > > What I'm trying to say is that the server is not going to do a lot of > > computation for each request. The server will simply update it's state > > and respond about it's success. > > This reminds me of coroutines or userland select- or kqueue-based > "threading." Coroutines is a bit more complex but a library is available. > Select-based "threads" aren't too difficult to set up in C, you could use > http://www.nightmare.com/medusa, a Python implementation, as a starting > point. Or use the very nice "eventlib" package from the ISC. It is released as a part of BIND, and you can find it in FreeBSD's "src/contrib/bind/lib/isc" directory (along with some other stuff). John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message