> > Many thanks for your reply. The use case is per request, and I would be > grateful to learn more about thread-local storage.
There are several ways. I'm not familiar with mod_python, but I guess you get a dict-like object for the request parameters. In python, this is usually writable (in contrast to the darn J2EE-spec'ed HttpRequest) So just add a new key, e.g. "working_state", to it. Under that, file those variables. Alternatively, there are recipes out there (http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/302088 ) that give you basically a dictionary keyed with the current thread. That is helpful if you have computations deeper in code that can't get a hold on the request object. Might be the case in mod_python - in cherrypy, the request itself is thread-locally stored, so you can get it whereever you need. Diez -- http://mail.python.org/mailman/listinfo/python-list