From owner-freebsd-hackers Thu Nov 16 10:38: 1 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id B9B3437B479 for ; Thu, 16 Nov 2000 10:37:59 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id eAGIbr509987; Thu, 16 Nov 2000 10:37:53 -0800 (PST) Date: Thu, 16 Nov 2000 10:37:53 -0800 From: Alfred Perlstein To: Nicolai Petri Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Multithreaded tcp-server or non-blocking ? Message-ID: <20001116103753.C830@fw.wintelcom.net> References: <021501c04fb9$574f9030$6732a8c0@atomic.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <021501c04fb9$574f9030$6732a8c0@atomic.dk>; from nicolai@petri.cc on Thu, Nov 16, 2000 at 11:38:14AM +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Nicolai Petri [001116 02:37] wrote: > What's the best approach for a simple web-server(never more the 10 clients) > ? Is it using pthread and a thread per connection . Or to make a > non-blocking single thread server. Can people show me some simple examples > of the 2 techniques ? > > And what's the pro's and con's for the 2 methods ??? Because you want something simple, I would use a thread per connection. For a more complex/high-perfomance server you'd want to use several threads using event queues and perhaps external processes for disk IO. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message