From: Vlad S. <vl...@cr...> - 2006-01-04 15:13:30
|
> I find it confusing that the actual spooling code is not in the > SpoolThread, but still in SockRead(). > Take a look at nsd/task.c. I think you should be able to implement > this as a Ns_Task callback, which gives you the extra thread and all > the poll handling etc. for free. Move the spooling code from SockRead > into the task callback. > > Can you split out the upload stats code. One functional change at a > time is much easier to follow. > The main reason to reuse driver.c is that spooler is alsmost identical to driver thread, and uses the same functions as driver. Spooler can be disabled(config option), in this case driver works as usual. Also it does parsing and other Sock related things like conn queueing, making it in tasks would result in very big code duplication just to run it in generic socket callback thread. I think it benefits from being in driver.c, it is very specific and does what is supposed to do. Also upload stats belongs to spooler as well, otherwise we get another round of locking optimisation. -- Vlad Seryakov 571 262-8608 office vl...@cr... http://www.crystalballinc.com/vlad/ |