Re:Global Interpreter Lock, or how to kill it
by viraptor on Wednesday June 29, 2011 @06:08PM
(#2711601)
I had this on my mind for some time, and this seems a good time to ask: why wouldn't python have an "unsafe" mode. If the internals were threadsafe, why couldn't we have a version of python that will explode on threading mistakes and it's up to the user to make sure the proper places are locked? Basically, the same level of guarantee that C provides. I'd be happy to use that version in places where it's needed. Same version of threading was possible in Perl (use if what you're doing is threadsafe, expect coredumps otherwise).
[ Parent
| on HN ]
Re:Global Interpreter Lock, or how to kill it
by ezyang on Wednesday June 29, 2011 @09:17PM
(#2712075)
That's the problem: the internals of Python are not thread safe. Essentially every library backing up Python is written without thread safety in mind, and this is precisely why the GIL is necessary.
Re:Global Interpreter Lock, or how to kill it
by mattgreenrocks on Thursday June 30, 2011 @12:40AM
(#2712630)
Would the concept of 'unsafe' Python fit into the ideology of the language?
I'm wondering myself, not sure either way I'd choose. I'm tempted to say, "no, it would not fit the language ideology" but ctypes lets you shoot yourself in the foot if you go down that path. :)