> From: <[EMAIL PROTECTED]>
> 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 .
> That is probably simplest from a programming point of view.
That's sounds fine to me.. :o)

> > Or to make a
> > non-blocking single thread server.
> That will probably give you the best performance. It willl probably use
> slightly less RAM as well but not enough to be of an issue unless you are
> trying to fit in 4MB or something.
I've got plenty of RAM. It's more a question of stability / simplicity.

> > Can people show me some simple examples
> > of the 2 techniques ?
> As in web servers that use one or the other method or are you just after
> software that uses pthreads and/or non blocking I/O?
> For non blocking I/O you are probably after select, poll or kqueue.
I'm quite lost here.. Is there a good reason for using kqueue instead of
select/poll ?

> I have a basic program that uses pthreads if that will help...it uses
> kqueue as well although not for non blocking I/O. Its not finished but the
> threading part works...
I would love to see the code.. I'm having some stability problems with my
own code. Maybe I can figure out where I went wrong.

> > And what's the pro's and con's for the 2 methods ???
>
> It really does depend on what you're trying to acheive...I'd tend to go
> for the threads solution with the argument that the programmers time is
> worth far more than the extra hardware it would take to make up any minor
> performance penalty.
I personally prefer the most simple and failsafe solution. Too much
performance hunting will often give less understandable/debugable code.

---
Thanks for your good answers.
- Nicolai Petri




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to