Re: per interpreter storage for C extensions

2006-12-30 Thread Martin v. Löwis
Robin Becker schrieb: > What is worrying is that in the extension init we're creating an > exception and version string etc and holding a pointer to them in C; is > it safe to use the same exception in different interpeters? It is safe as long as the base exception classes are also shared across

Re: per interpreter storage for C extensions

2006-12-30 Thread Robin Becker
Martin v. Löwis wrote: > Robin Becker schrieb: >> Is there a simple/cheap way for C code to cache these sorts of module >> level globals on a per interpreter basis? Is there even a way to tell >> which interpreter I'm being called in? > > There is no cheap way to add to the interpreter state. As C

Re: per interpreter storage for C extensions

2006-12-29 Thread Martin v. Löwis
Robin Becker schrieb: > Is there a simple/cheap way for C code to cache these sorts of module > level globals on a per interpreter basis? Is there even a way to tell > which interpreter I'm being called in? There is no cheap way to add to the interpreter state. As Chris Mellon explains, you can us

Re: per interpreter storage for C extensions

2006-12-28 Thread Graham Dumpleton
Chris Mellon wrote: > 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. No. In mod_python there can be multiple distinct interpreter instances in each Apache child process. If using a multithreaded Apache M

Re: per interpreter storage for C extensions

2006-12-28 Thread Chris Mellon
On 12/28/06, Robin Becker <[EMAIL PROTECTED]> wrote: > Robin Becker wrote: > > Chris Mellon wrote: > >> On 12/28/06, Robin Becker <[EMAIL PROTECTED]> 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_

Re: per interpreter storage for C extensions

2006-12-28 Thread Robin Becker
Robin Becker wrote: > Chris Mellon wrote: >> On 12/28/06, Robin Becker <[EMAIL PROTECTED]> 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 tha

Re: per interpreter storage for C extensions

2006-12-28 Thread Robin Becker
Chris Mellon wrote: > On 12/28/06, Robin Becker <[EMAIL PROTECTED]> 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 storag

Re: per interpreter storage for C extensions

2006-12-28 Thread Chris Mellon
On 12/28/06, Robin Becker <[EMAIL PROTECTED]> 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. > > Unfortunately we have C code that seems incompatible with mod_python and I'm > looking for ways to improve