This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients Danilo Shiga, JelleZijlstra, mark.dickinson, martin.panter, osantana, pitrou, serhiy.storchaka
Date 2017-05-25.10:13:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1495707234.79.0.292099278273.issue30441@psf.upfronthosting.co.za>
In-reply-to
Content
> Isn't list(dict) atomic? At least in CPython.

I doubt it. There's no special code for list(dict), it uses regular iteration which could probably hit the GC and then release the GIL.

> I suspect that protecting *all* accesses to _data with a lock will hit the performance and invalidate the reason of using _data for caching.

I'm not convinced os.environ is performance-critical.  Perhaps getenv() is really expensive on some systems?
History
Date User Action Args
2017-05-25 10:13:54pitrousetrecipients: + pitrou, mark.dickinson, martin.panter, serhiy.storchaka, osantana, JelleZijlstra, Danilo Shiga
2017-05-25 10:13:54pitrousetmessageid: <1495707234.79.0.292099278273.issue30441@psf.upfronthosting.co.za>
2017-05-25 10:13:54pitroulinkissue30441 messages
2017-05-25 10:13:54pitroucreate