From owner-freebsd-hackers Thu Aug 17 10: 7:48 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from resnet.uoregon.edu (resnet.uoregon.edu [128.223.122.47]) by hub.freebsd.org (Postfix) with ESMTP id 49DF337BB52 for ; Thu, 17 Aug 2000 10:06:05 -0700 (PDT) Received: from localhost (dwhite@localhost) by resnet.uoregon.edu (8.10.1/8.10.1) with ESMTP id e7HH5qB08240; Thu, 17 Aug 2000 10:05:53 -0700 (PDT) Date: Thu, 17 Aug 2000 10:05:52 -0700 (PDT) From: Doug White To: Jonas Bulow Cc: hackers@FreeBSD.ORG Subject: Re: freebsd and non-preemtive threads In-Reply-To: <3997C2C5.83AFE056@servicefactory.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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. Also most NNTP servers have been using techniques like this for years. The key to these types of systems is that they don't spend much time per request. 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