Grab a tarball from http://dev.apache.org/from-cvs/apache-apr/ to look
at an attempt to do this in a multiprocess multithreaded web server.
See the pthreads/ subdirectory in the tarball for the server itself.
The code is most definitely in pre-alpha state.
We have two methods in the code (selectable with a #define) for
distributing connections to threads. One is with a pool of threads in
an accept() loop (one per listening socket) pushing connections onto a
queue, and another pool of worker threads popping connections off the
queue and handling them.
Another is very similar to the Apache 1.3 model. Every thread is in a
loop of
accept_mutex_lock()
poll() all listening sockets
accept a connection
accept_mutex_unlock()
process_connection()
-- Manoj Kasichainula - manojk at io dot com - http://www.io.com/~manojk/ "Violence is the first refuge of the violent." - Aaron Allston- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/