SMP, GIL and Threads

Greg Copeland gtcopeland at gmail.com
Fri Dec 16 13:59:44 EST 2005


In situations like this, you need to guard the resource with a mutex.
In Python, things like insertions are atomic but iterations are not.
Thusly, if you wrap it with a mutex, things can be made safe.  I saw,
"can be", because you then have to ensure you always use the mutex to
satify your concurrent access requirements.

Greg




More information about the Python-list mailing list