httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Bannert <>
Subject converting AP_CHILD_THREAD_FROM_ID into two macros
Date Wed, 26 Sep 2001 22:25:19 GMT
Would anyone have a problem if I converted AP_CHILD_THREAD_FROM_ID from
a macro that returns "n,m" to two macros that each return an int?

I'd like to do this for a couple reasons:

1) it gives us the opportunity to reduce the number of times this calculation
   is performed. Right now for example with worker, the calculations (id
   / HARD_SERVER_LIMIT) and (id % HARD_SERVER_LIMIT) are performed up
   to 4 times for a single request (see modules/http/http_core.c:271),
   and possibily an additional 3 more times for each pipelined request.
   That's only in that one function! I know of other places that could
   take advantage of this.  If AP_CHILD_THREAD_FROM_ID could return
   something assignable, we could cache this result and simple use it
   over and over. I've seen some pretty bad compiler-generated division
   routines before that this could avoid.

2) it makes it more readable (one must admit that it is rather unintuitive
   to have a macro that can only be used in a parameter list).

The changes this would incur would be individually small, but they
will have to happen all over the place.


View raw message