Cache management in a mod_python environment
Joel Welling <[email protected]> Fri, 04 Sep 2009 13:23:00 -0400
| Newsgroups | gmane.comp.python.mod_python |
|---|---|
| Organization | Pittsburgh Supercomputing Center |
| Message-ID | <1252084980.10347.20.camel@welling-laptop> |
Hi folks; I've written a web utility which generates images in mod_python, and I'd like to keep recently generated images in a LRU cache. I don't understand the threading environment, however, and if many instances of my app try to manage the cache simultaneously they'll get it wrong. If I run a mod_python page under apache, each httpd ends up creating its own instance of the mod_python program, correct? If a given httpd services two requests at the same time, does a separate instance of the module get created or does the function generating the page get run in two different threads? Is there any data structure I can attach cache information to that will survive between requests within the same httpd? Thanks, -Joel Welling [email protected]