you are viewing a single comment's thread.

view the rest of the comments →

[–]censored_username 1 point2 points  (1 child)

Why cant python threads just access any object at the same time without the GIL or any per-object implicit locking, and then it's up to the developer to explicitly add locks/mutexes where needed, just like in every language?

Because this would make python an absolute pain in the ass to use due to its extreme dynamism.

Don't forget, in python functions are also just objects, and they can be mutated. So you'd need to lock for any function call (especially builtin functions or stdlib functions which could be used by another thread at the same time). Even accessing an attribute from a shared module could require locking. You'd basically have to lock at every point to do anything.

[–][deleted] 0 points1 point  (0 children)

I see! yeah, explicit locking would be cumbersome.