is +=1 thread safe

Alexander Schmolck a.schmolck at gmail.com
Sat May 3 19:10:33 EDT 2008


AlFire <spamgrinder.trylater at ggmail.com> writes:

>> The threading module already has a function to return the number of Thread
>> objects currently alive.
>
> I have threads within threads - so it does not suit me :-(.

How about using a scalar numpy array? They are mutable, so I assume that x +=
1 should be atomic.

'as



More information about the Python-list mailing list