httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Ames <>
Subject Re: Virutal Host Statistics
Date Sat, 21 Apr 2001 07:49:47 GMT
dean gaudet wrote:
> On Sun, 8 Apr 2001, Ian Holsman wrote:
> > is 'a += X' thread safe ?
> no.
> however on every multiprocessing platform i know of there is an atomic way
> to do that (without first aquiring a mutex)... it's just not exposed in
> the pthread API.
> > if it isn't .. would we care... we could get some pretty usefull estimates
> > regardless.
> maybe.  if you're using single-cpu machines then they'll be pretty good
> estimates.  on multi-cpu boxes you just don't know.

In OS/390 TCP/IP, we found that judicious removal of compare-and-swap
(atomic) updating of SNMP type counters gave us measurable CPU savings,
without harming data integrity unacceptably.  The boxes were up to 10
way multiprocessors back then.  

The trick is "judicious" - if the number has to be dead-on accurate, and
it can be updated simultaneously by multiple processors, then we used
atomic updates - there's no other choice.  But if you are talking bytes
transmitted over an interface, who cares if netstat says 1.354 gazillion
when it should really say 1.355 gazillion?  Not us, so we saved some


View raw message