Re: dictionary doesn't get properly updated

2010-10-07 Thread jimgardener
right..that is what was happening.. thanks for pointing it out.. regards jim On Oct 7, 11:41 pm, Doug wrote: > Could it be that garbage collection is deleting your "tm" instance > when it falls out of scope at the end of the view call?  If that is > the only place you've instantiated it, I'm gues

Re: dictionary doesn't get properly updated

2010-10-07 Thread Doug
Could it be that garbage collection is deleting your "tm" instance when it falls out of scope at the end of the view call? If that is the only place you've instantiated it, I'm guessing the reference count would go to zero 'singleton' or not. -- You received this message because you are subscrib

Re: dictionary doesn't get properly updated

2010-10-07 Thread Steve Holden
I don't believe so, guess you have to keep looking. regards Steve On 10/7/2010 11:46 AM, jimgardener wrote: > I am using the development server..will that cause such a problem? > jim > >> Are you sure that everything is being run in the same process? If (for >> example) you are using Apache as

Re: dictionary doesn't get properly updated

2010-10-07 Thread jimgardener
I am using the development server..will that cause such a problem? jim > Are you sure that everything is being run in the same process? If (for > example) you are using Apache as a front-end then, as I understand it, > there are no guarantees about that. > > regards >  Steve > -- > DjangoCon US 20

Re: dictionary doesn't get properly updated

2010-10-07 Thread Steve Holden
On 10/7/2010 10:20 AM, jimgardener wrote: [...] > > When the view add_new_threadobj() is executed a couple of times,this > is the print output > adding for the first time, > tm= > TM::before::threads: {} > TM:: add_thread()::added=threadname1 > TM::after::threads: {'threadname1': daemon)>} > >

Re: dictionary doesn't get properly updated

2010-10-07 Thread jimgardener
hi this is what I wrote class MySingleton(object): _instance = None def __new__(cls, *args, **kwargs): if not cls._instance: cls._instance = super(MySingleton, cls).__new__(cls) return cls._instance I did unit test on this .. def setUp(self): self.tm=TM()

Re: dictionary doesn't get properly updated

2010-10-07 Thread Daniel Roseman
On Oct 7, 3:20 pm, jimgardener wrote: > hi > In my django view ,I am creating a Thread subclass and adding it to a > ThreadManager TM to keep in a dictionary with name of thread as key > and instance as value.I have implemented TM as a singleton and > verified that only one instance of TM exists .

dictionary doesn't get properly updated

2010-10-07 Thread jimgardener
hi In my django view ,I am creating a Thread subclass and adding it to a ThreadManager TM to keep in a dictionary with name of thread as key and instance as value.I have implemented TM as a singleton and verified that only one instance of TM exists .However,when the view calls tm.add_mythread() ,I