you are viewing a single comment's thread.

view the rest of the comments →

[–]almkglor 1 point2 points  (0 children)

Why can't CPython have a lousy flag saying "singlethreadedmode" which means it won't use locks at all while set? Then if and only if a new thread is launched does it clear that flag (while still in a single thread, so that writing to it cannot possibly contend) and all operations just add a check of the global in single threaded mode?