3 ms·
By 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
by FartyMcFarter 8y ago
By 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.