Re: multiprocessing.sharedctypes and built-in locks

2009-03-16 Thread Ahmad Syukri b
On Mar 16, 5:19 pm, Aaron Brady wrote: > It's not one of the guarantees that Python > makes.  Operations aren't atomic by default, such as unless stated > otherwise.   Well, in the documentation for RawArray: "Note that setting and getting an element is potentially non-atomic – use Array() instea

Re: setattr() on "object" instance

2009-03-15 Thread Ahmad Syukri b
On Mar 16, 1:21 pm, Sean DiZazzo wrote: > Why is it that you can setattr() on an instance of a class that > inherits from "object", but you can't on an instance of "object" > itself? > > >>> o = object() > >>> setattr(o, "x", 1000) > > Traceback (most recent call last): >   File "", line 1, in >

Re: multiprocessing.sharedctypes and built-in locks

2009-03-15 Thread Ahmad Syukri b
On Mar 15, 6:19 am, Aaron Brady wrote: > > Your code hung on my machine.  The call to 'main()' should be in an > 'if __name__' block: > > if __name__== '__main__': >     main() > > Is it possible you are just seeing the effects of the non-atomic > '__iadd__' operation?  That is, the value is read,