[Python-Dev] Intricacies of calling eq (original) (raw)
Hrvoje Niksic hrvoje.niksic at avl.com
Wed Mar 19 14:08:13 CET 2014
- Previous message: [Python-Dev] Intricacies of calling __eq__
- Next message: [Python-Dev] Intricacies of calling __eq__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 03/18/2014 10:19 PM, Paul Moore wrote:
Surely in the presence of threads the optimisation is invalid anyway
Why? As written, the code uses no synchronization primitives to ensure that the modifications to the dict are propagated at a particular point. As a consequence, it cannot rely on the modification done at a time that coincides with execution at HERE to be immediately propagated to all threads.
The optimization is as valid as a C compiler rearranging variable assignments, which also "breaks" unsychronized threaded code.
- Previous message: [Python-Dev] Intricacies of calling __eq__
- Next message: [Python-Dev] Intricacies of calling __eq__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]