5 ms·
I want it to have the GIL, because I want it to maintain compat with C extensions. We already have a plan to bypass the GIL: multi interpreters. Having an imp
by sametmax 8y ago
I want it to have the GIL, because I want it to maintain compat with C extensions.
We already have a plan to bypass the GIL: multi interpreters.
Having an implementation in Rust may make future improvement to Python easier, so it's better to have something exactly similar first, then start to hack it.
- FartyMcFarter 8y agoBy multi interpreters do you mean several interpreter processes without shared memory? (or only limited memory sharing) CPython can do that too, but this isn't really multi-threading, and it only bypasses the GIL in a very trivial sense. But yeah, keeping the GIL is probably the only reasonable way to go if you want compatibility with existing extensions.
- deleted 8y ago[deleted]
- sametmax 8y agoYes. Actually you get one gil per interpretter, and can spawn your thread in sub interpretter. Cpython could do it, but currently can't provide much since the api to do it is only accessible from c.
- FartyMcFarter 8y agoDoesn't CPython do this with the multiprocessing module? https://docs.python.org/2/library/multiprocessing.html https://docs.python.org/2/library/multiprocessing.html
- sametmax 8y agoNo, this spawns several process, while sub interpretters allow you to have several of them in one single process, making data sharing much cheaper.