threads and extension module initialization

pianomaestro at gmail.com pianomaestro at gmail.com
Fri Mar 28 11:25:55 EDT 2008


On Mar 28, 11:14 am, "Gabriel Genellina" <gagsl-... at yahoo.com.ar>
wrote:
> En Fri, 28 Mar 2008 11:51:10 -0300, <pianomaes... at gmail.com> escribió:
>
> > I have an extension module that gets initialized multiple
> > times because I am using threads.
>
> And do you want thread local variables?

no

>
> > How can this module access global state (not per-thread state) ?
> > It needs to create a singleton.
>
> C global variables are global, not per-thread.

Yes, but they get initialized once per-thread, therefore my singleton
gets
created multiple times.

Simon.

>
> --
> Gabriel Genellina




More information about the Python-list mailing list