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
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
Did you try just creating a new socket every time you do a connect ?
On Mar 28, 10:01 am, Jason Kristoff wrote:
> I'm trying to make something that once it is disconnected will
> automatically try to reconnect. I'll add some more features in later so
> it doesn't hammer the server but right now
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.
Simon.
--
http://mail.python.org/mailman/listinfo/python-list
I have a cython extension module "mux" where the initialization is
being
called more than once (the initmux c function).
I am wondering if my use of multiple threads causes this. Can't
multiple
threads share the same python module ?
The threads are being created from an external C library.
I just
Simon Forman wrote:
> But that's a function, not a class. When you assign add to an
> attribute of Item it "magically" becomes a method of Item:
>
Yes, I am looking to understand this magic.
Sounds like I need to dig into these descriptor thingies (again).
(sound of brain exploding)..
Simon.
Simon Forman wrote:
>
> "Item.__add__ = Add" is a very strange thing to do, I'm not surprised
> it didn't work.
Yes it is strange.
I also tried this even stranger thing:
class Item(object):
class __add__(object):
def __init__(self, a, b=None):
print self, a, b
self.a = a
Gabriel Genellina wrote:
> At Friday 25/8/2006 00:36, [EMAIL PROTECTED] wrote:
>
> ># This is what I have in mind:
> >
> >class Item(object):
> > def __add__(self, other):
> > return Add(self, other)
>
> And this works fine... why make thinks complicated?
Yes, I agree it's simpler, and up u
# This is what I have in mind:
class Item(object):
def __add__(self, other):
return Add(self, other)
class Add(Item):
def __init__(self, a, b):
self.a = a
self.b = b
a = Item()
b = Item()
c = a+b
# Now, I am going absolutely crazy with this idea
# and using it in a big way. So
Martin v. Löwis wrote:
> Simon Burton wrote:
> > I'm having some trouble linking one extension module to another because
> > the linker expects a "lib" prefix and my python modules cannot have
> > this prefix.
>
> This is a Good Thing (tm) :-) Don't link extension modules to each
> other; this is
10 matches
Mail list logo