Re: Threads and racing conditions

2007-08-22 Thread Nils Oliver Kröger
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Flavio Preto schrieb: > Hi, > > I have a doubt. Supose that i have the minimun class below: > > class db: > def __init__(self): > self.db = {} > def read(self, key): > return self.db[key] > def write(self, key, value): >

Threads and racing conditions

2007-08-21 Thread Flavio Preto
Hi, I have a doubt. Supose that i have the minimun class below: class db: def __init__(self): self.db = {} def read(self, key): return self.db[key] def write(self, key, value): self.db[key] = value and an object of this class is shared among some threads. Is