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 once more
Date Thu, 14 Jun 2007 15:49:42 GMT
Hi all,

I've got some response which shows that I was not clear enough in my previous 
post. Fullproof solution would be:

Index: server/mpm/worker/worker.c
--- server/mpm/worker/worker.c  (revision 545597)
+++ server/mpm/worker/worker.c  (working copy)
@@ -892,7 +887,7 @@
          bucket_alloc = apr_bucket_alloc_create(ptrans);
          process_socket(ptrans, csd, process_slot, thread_slot, bucket_alloc);
          worker_sockets[thread_slot] = NULL;
-        requests_this_child--; /* FIXME: should be synchronized - aaron */
+        apr_atomic_dec32(&requests_this_child); /* much slower than important */
          last_ptrans = ptrans;
Because we don't care about if (requests_this_child <= 0) it would be enough. But 
it is too way slow and is not so important.
So, the question is:
If on x86 we have native atomic 'subl $0x1,mem' which is almost as fast as 
optimized mov dec mov, why not to use platform specific feature. As for now x86 
represents majority of hosts.

PS I have found 21 atomic dec/inc in trunk and more than half of them are about 
counters similar to the case above.

Best regards,

View raw message