Message302932
It's difficult to make a choice between Benjamin's PR 3670 and Serhiy's PR 3672.
Benjamin wrote that about his PR:
> No attempt is made to define or provide "reasonable" semantics for iterating
> over a file on multiple threads. (Non-crashing) races are still
> present. Duplicated, corrupt, and missing data will happen.
I'm not confortable with the idea of data corruption. I'm not confortable with breaking backward compatibility neither. IMHO the key question is if anyone actually use a file object at the same time in multiple threads. Since, it's likely that iterating on the same object crash, I'm not sure that anyone do it.
If someone rely on the feature, we should maybe explain how to handle properly the issue: use a lock.
I have a preference for Serhiy's PR 3672. It's simple, the error is easy to understand. Maybe his PR just lacks a mention in "Porting to Python 2.7" section of What's New in Python 2.7 and/or the NEWS entry. Suggest to use a lock for example. |
|
Date |
User |
Action |
Args |
2017-09-25 09:14:35 | vstinner | set | recipients:
+ vstinner, lemburg, gvanrossum, pitrou, benjamin.peterson, serhiy.storchaka |
2017-09-25 09:14:35 | vstinner | set | messageid: <1506330875.06.0.690599430254.issue31530@psf.upfronthosting.co.za> |
2017-09-25 09:14:35 | vstinner | link | issue31530 messages |
2017-09-25 09:14:34 | vstinner | create | |
|