httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmytro Fedonin <Dmytro.Fedo...@Sun.COM>
Subject one word syncronize
Date Thu, 14 Jun 2007 09:15:42 GMT
Hi all,

Looking through 'server/mpm/worker/worker.c' I have found such a 
combination of TODO/FIXME comments:
/* TODO: requests_this_child should be synchronized - aaron */
if (requests_this_child <= 0) {
requests_this_child--; /* FIXME: should be synchronized - aaron */

And I can not see any point here. These are one word CPU operations, 
thus there is no way to preempt inside this kind of operation. So, one 
CPU is safe by nature of basic operation. If we have several CPUs they 
will synchronize caches any way, thus we will never get inconsistent 
state here. We can only lose time trying to synchronize it in code. Am I 
not right?

PS My assumptions are several threads of the same process are dealing 
with one word of common memory.

Best regards,

View raw message