Am 03.01.2006 um 16:47 schrieb Vlad Seryakov:
Spool thread can be a replica of driver thread, it will do the same
as driver and then pass Sock to the conn thread. So making it C-
based is not that hard and still it will be fast and small.
Plus, upload statistics now will be handled in the spool thread,
not driver thread, so no overhead and slowdown.
So we read up to maxreradahead, then queue it into spooling thread
and spooling thread will give it to conn thread. Spooling thread
will use same Sock/Driver structures, actually Sock will not see
any differences between running in driver thread or spooling thread.
I can try to provide test of using spooling thread along with
driver thread today if i will have time.
This is all true, and perhaps the easiest way to get
to the result on the short term. I appreciate very
much the effort you're doing and we will definitely
use it, as soon as you get something working stable
enough.
Still, our precious (little) server would definitely
benefit from some additional event-loop-type of
processing where you need not spawn a thread for
just about anything. Tcl has come long way with
their simple event loop and single-thread approach.
Ultimately I can imagine something like:
---------
|
driver_thread
/ \
conn_threads spool_threads
| |
blocking_io nonblocking-io
where one would do blocking IO (db stuff etc) whereas
the other can be used for simple non-blocking ops like
copy_file_to_socket or vice-versa types of operations.
Zoran