What I have/had in mind is aync writes from the driver thread.
Most of the OS'es have this feature (kaio) so we can employ it.
The question of locking, however still remains in such case.
So the decision has to be made on: what is cheaper? Locking
or spooling to disk out of the conn thread? I have no real-life
experience but I'm inclined to believe that spooling out of the
conn thread would be more costly.
We d locking in nsd in a lot of places anyway, locking itself is not the
issue if it does it for very short time, of course, everything is
serialized.
The other solution could be special-formatted query arguments that will
tell to do upload statistics, looks like a hack but why not, it is
web/application server, it can introduce specific protocol extensions.
something like: /upload/url?arg1=1&arg2=2;ns_upload_stats=1
Another possible solution can be, pre-allocating maxconn upload structs
and update them without locks, it is integer anyway, so no need to lock,
4 byte write is never innterupted, usually it is 1 CPU instruction(true
for Intel, maybe not for Sparc).
In the request for upload stat thread, we scan that array for matching
url and return upload stats. So driver thread is writing only, other
thread are reading only.
--
Vlad Seryakov
571 262-8608 office
[EMAIL PROTECTED]
http://www.crystalballinc.com/vlad/