Tom Schindl wrote: >> You're right, I've should have printed $r, which yields: >> >> Apache2::RequestRec=SCALAR(0x9d44644) [first n times] >> Apache2::RequestRec=SCALAR(0x9d7e0a4) >> (n begin the number of apache children) >> >> Am I correct in assuming that the Apache2::RequestRec object is now >> sitting in 0x9d44644 or is that just the mem address of the scalar, which >> changes, but is still pointing to the same RequestRec. > > No. For every Request a ***NEW*** Request object is created! It's only > the pointer to it is written to the same location (e.g. 0x9d44644) but > maybe I'm not correct here.
Ah, i see, but then my question remains, why is this location changed after n hits (n = # of apache children) > Where from do you know that the request is served from a different child I've used $$ as you suggested, from that I know that apache hits its children in a round robin fashion (at least when I'm the only one doing a page reload) > You have to also print the $$ if your are running in prefork mpm, if you > are running in a threaded mpm I have no idea how to distinguish between > the different threads although there surely exists a thread ID or > something like this. I'm running in prefork mpm mode, with $$ the result looks like this: # code handler () { $r = shift; print STDERR $$." ".$r."\n"; return OK; } # result 26687 Apache2::RequestRec=SCALAR(0x922937c) 26688 Apache2::RequestRec=SCALAR(0x922937c) 26690 Apache2::RequestRec=SCALAR(0x922937c) 26691 Apache2::RequestRec=SCALAR(0x922937c) 26694 Apache2::RequestRec=SCALAR(0x922937c) 26696 Apache2::RequestRec=SCALAR(0x922937c) 26698 Apache2::RequestRec=SCALAR(0x922937c) 26700 Apache2::RequestRec=SCALAR(0x922937c) 26702 Apache2::RequestRec=SCALAR(0x922937c) 26704 Apache2::RequestRec=SCALAR(0x922937c) - my apache has 10 children at the moment 26687 Apache2::RequestRec=SCALAR(0x9193884) - stays the same for another 9 hits, then changes again > Tom -- kind regards, Tim Esselens