cgi concurrency approaches?

Matt Goodall matt at pollenation.net
Fri Jan 23 05:22:59 EST 2004


On Fri, 2004-01-23 at 10:04, Rene Pijlman wrote:
> Paul Rubin <http://phr.cx@NOSPAM.invalid>:
> >I'm wondering if folks here have favorite lightweight ways of dealing
> >with concurrency in cgi's.  Take a simple case:
> >
> >You want to write a cgi that implements a simple counter.  The first
> >time it's called, it prints "1".  The next time, "2", etc.
> [...]
> >Anyone have some simpler approaches?
> 
> Use mod_python and keep the counter in a Python variable (if the value
> needs not be persistent).
> http://www.modpython.org/

That will only work if you use Apache 2 in threaded mode. Apache 1  and
Apache 2 in forking mode (multiple processes) will have a copy of the
counter object per-process.

Cheers, Matt

-- 
Matt Goodall, Pollenation Internet Ltd
w: http://www.pollenation.net
e: matt at pollenation.net

Any views expressed are my own and do not necessarily reflect the
views of my employer.





More information about the Python-list mailing list