[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: global(?) incrementing _and_ decrementing!
From:       Richard Foley-A1503C <Richard_Foley-A1503C () email ! mot ! com>
Date:       1998-04-15 14:36:03
[Download RAW message or body]

Hi again,

> >$testap::CALLED++;
> >True to form, it increments, but only _sometimes_.  The sequence goes
> >something like this:  1, 2, 3, 3, 3, 4, 5, 6, 6, 3, 3, 7, 8, 3, 9, etc..

> I would say that it'll be obvious in hindsight, but then somebody will
> eloquently point out that I've got it all wrong.  So, I won't.
Hindsight is a wonderful thing :-) and I think I've got it now.

> I'd say that every copy of your variable is being strictly incremented, but
> you've got several copies running all at once.  Either you have to limit
Excellent, of course!

> Apache to a single child process for serving http requests (with attendant
> limitations on the ability to handle multiple requests), or you'll have to
> start playing with shared memory or another solution to this problem.
In this particular case it doesn't matter, I'm happy to have the global
_within_ each server process now that I know that this is what is happening.
As I recall reading somewhere it's the first call that's likely to be slow,
etc...  It just had me soundly confused for a thankfully short while.  Thanks.

> --Jon Radel
> jon@radel.com
Thanks, Jon, and all the others who replied so promptly with a similar explanation.

Richard

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic