Re: Synchronization methodology

2007-01-03 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Chris Ashurst wrote: Hi, I'm coming in from a despised Java background, and I'm having some trouble wrapping my head around sharing an object between multiple instances of a single class (in simpler terms, I would say imagine a simple chat server that has to share a

Re: Synchronization methodology

2007-01-03 Thread [EMAIL PROTECTED]
Chris Ashurst wrote: Hi, I'm coming in from a despised Java background Consider strongly the fact that Python supports multiple process solutions well, so you're not stuck having to use multithreaded solutions in every circumstance (but can still use them when necessary). --

Re: Synchronization methodology

2007-01-03 Thread Paul Rubin
Chris Ashurst [EMAIL PROTECTED] writes: Hi, I'm coming in from a despised Java background, and I'm having some trouble wrapping my head around sharing an object between multiple instances of a single class (in simpler terms, I would say imagine a simple chat server that has to share a list of

Re: Synchronization methodology

2007-01-03 Thread Paul Rubin
Paul Rubin http://[EMAIL PROTECTED] writes: # add the user to the connected user list, with timestamp and remote IP status = request(user_list.append, self, time(), remote_ip=whatever) Editing error, ignore the self, arg up there. Of course there may be other mistakes too, I didn't test

Re: Synchronization methodology

2007-01-03 Thread Duncan Booth
Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: You may want to make sure the lock will be released in case of an exception: def foo(self): self.lock.aquire() try: pass # code finally: self.lock.release() In Python 2.5 this can also be written more

Re: Synchronization methodology

2007-01-03 Thread Jeremy Dillworth
Hi Chris, Have you looked at the mutex module? Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Synchronization methodology

2007-01-02 Thread Chris Ashurst
Hi, I'm coming in from a despised Java background, and I'm having some trouble wrapping my head around sharing an object between multiple instances of a single class (in simpler terms, I would say imagine a simple chat server that has to share a list of connected users to each instance of a