Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Nov 2000 10:37:53 -0800
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Nicolai Petri <nicolai@petri.cc>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Multithreaded tcp-server or non-blocking ?
Message-ID:  <20001116103753.C830@fw.wintelcom.net>
In-Reply-To: <021501c04fb9$574f9030$6732a8c0@atomic.dk>; from nicolai@petri.cc on Thu, Nov 16, 2000 at 11:38:14AM %2B0100
References:  <021501c04fb9$574f9030$6732a8c0@atomic.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
* Nicolai Petri <nicolai@petri.cc> [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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001116103753.C830>