Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Nov 2000 04:21:32 -0800 (PST)
From:      Alex Belits <abelits@phobos.illtel.denver.co.us>
To:        Nicolai Petri <nicolai@petri.cc>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Multithreaded tcp-server or non-blocking ?
Message-ID:  <Pine.LNX.4.20.0011160414480.16899-100000@phobos.illtel.denver.co.us>
In-Reply-To: <021501c04fb9$574f9030$6732a8c0@atomic.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 16 Nov 2000, Nicolai Petri 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 ???

  I would prefer one process without nonblocking i/o, as multithreaded
program easily becomes hard to manage if you have any more or less complex
data model. However even apache-style multiple processes will work, and 
will be even simplier than either -- the disadvantage is only that it
will have to keep all processes independent, so some kinds of
processing will be hard to implement.

  I wrote my own HTTP server (fhttpd) that combines nonblocking main
process and multiple backend modules processes that can be blocking or
nonblocking -- it's possible that what you are trying to accomplish can
be done in fhttpd module without writing a full-blown server.

-- 
Alex

----------------------------------------------------------------------
 Excellent.. now give users the option to cut your hair you hippie!
                                                  -- Anonymous Coward



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.LNX.4.20.0011160414480.16899-100000>