Re: threads and extension module initialization

2008-03-28 Thread Gabriel Genellina
En Fri, 28 Mar 2008 13:17:44 -0300, Diez B. Roggisch <[EMAIL PROTECTED]> escribió: > [EMAIL PROTECTED] schrieb: >> I have an extension module that gets initialized multiple >> times because I am using threads. >> >> How can this module access global state (not per-thread state) ? >> It needs to

Re: threads and extension module initialization

2008-03-28 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > I have an extension module that gets initialized multiple > times because I am using threads. > > How can this module access global state (not per-thread state) ? > It needs to create a singleton. The question is very unclear. If you are after *not* initializing your

Re: threads and extension module initialization

2008-03-28 Thread Gabriel Genellina
En Fri, 28 Mar 2008 12:25:55 -0300, <[EMAIL PROTECTED]> escribió: > On Mar 28, 11:14 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Fri, 28 Mar 2008 11:51:10 -0300, <[EMAIL PROTECTED]> escribió: >> >> > How can this module access global state (not per-thread state) ? >> > It needs to c

Re: threads and extension module initialization

2008-03-28 Thread pianomaestro
On Mar 28, 11:14 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > C global variables are global, not per-thread. aha, a static pointer gets initialized to NULL, so I can check if it's not NULL in the module initializer. Thanks for jogging my brain, Simon. > > -- > Gabriel Genellina -- ht

Re: threads and extension module initialization

2008-03-28 Thread pianomaestro
On Mar 28, 11:14 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 28 Mar 2008 11:51:10 -0300, <[EMAIL PROTECTED]> 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 ca

Re: threads and extension module initialization

2008-03-28 Thread Gabriel Genellina
En Fri, 28 Mar 2008 11:51:10 -0300, <[EMAIL PROTECTED]> escribió: > I have an extension module that gets initialized multiple > times because I am using threads. And do you want thread local variables? > How can this module access global state (not per-thread state) ? > It needs to create a sing