3 ms·
My first thought was, like many others, "if they still share a GIL then why bother?" But if this is a first step along the road to that, then it's all good and
by anentropic 6y ago
My first thought was, like many others, "if they still share a GIL then why bother?"
But if this is a first step along the road to that, then it's all good and why not.
Another thought is: could this be a "thread-safe alternative to gevent" in some use cases?
I'm thinking particularly of web app hosting situation where you have something like uWSGI+gevent+your WSGI app
In that case, apart from the required gevent.monkeypatch (which presumably would not be needed with subinterpreters) your web app code does not explicitly do any stuff with gevent. But it is running in a gevent thread, so your web app code now has a non-obvious requirement to be thread-safe. This has bitten me with subtle bugs in the past.
I would be interested to explore the characteristics of a uWSGI+subinterpreter+WSGI app set up. It should avoid the thread-safety issue. Like gevent threads, the subinterpreters would share a GIL. I guess it might use more memory?