per interpreter storage for C extensions

Robin Becker robin at reportlab.com
Thu Dec 28 12:13:52 EST 2006


Robin Becker wrote:
> Chris Mellon wrote:
>> On 12/28/06, Robin Becker <robin at reportlab.com> wrote:
>>> As part of some django usage I need to get some ReportLab C extensions into a
>>> state where they can be safely used with mod_python.
> .........
>> Just off the top of my head, I'd think that using thread-local storage
>> instead of static would work, wouldn't it? I'm not that familiar with
>> mod_python but I'm surely each python interpreter is in a different
>> thread (if not process) than the others.
> 
> I was thinking along those lines and if that were the case then I could use
> 

....... reading further along those lines it seems there may be some hope of 
storing this stuff on the extension module (probably where it should belong) as 
it seems that new interpreters share extensions, but when the extension is first 
  imported a shallow copy is made of the module dict. That would seem to imply 
the  extension's module is private to each interpreter.
-- 
Robin Becker




More information about the Python-list mailing list