From: Vlad S. <vl...@cr...> - 2006-01-04 05:18:06
|
I am attaching the whole driver.c file because patch would not be very readable. See if this a good solution or not, it works and uses separate thread for all reading and spooling, also all upload stats are done in the spoller thread, so driver thread now works without any locking. Vlad Seryakov wrote: > I submitted Service Request with new patch with spooler support. Very > simple but seems to be working well. > > Zoran Vasiljevic wrote: > >> >> 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 >> >> >> ------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. Do you grep through log >> files >> for problems? Stop! Download the new AJAX search engine that makes >> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! >> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click >> _______________________________________________ >> naviserver-devel mailing list >> nav...@li... >> https://lists.sourceforge.net/lists/listinfo/naviserver-devel >> > -- Vlad Seryakov 571 262-8608 office vl...@cr... http://www.crystalballinc.com/vlad/ |