3 ms·
Python C extension modules can release the GIL while they're running which allows for true concurrency. See this Google code search http://www.google.com/codes
by jbarham 17y ago
Python C extension modules can release the GIL while they're running which allows for true concurrency. See this Google code search http://www.google.com/codesearch?q=python.org+lang%3Ac+Py_BEGIN_ALLOW_THREADS&hl=en&btnG=Search+Code http://www.google.com/codesearch?q=python.org+lang%3Ac+Py_BE... for example usage.
- fauigerzigerk 17y agoI know this is possible. But I'm having trouble to imagine a web app design (or other network server) based on that idea. In order to use a lot of data in memory I would have to have a single Python process that gets called by nginx or apache. So that would be a bottleneck even before I get a chance to call my extension. And later there wouldn't be much code left that executes in the Python interpreter, which kind of defeats the purpose. But I have to admit that I haven't fully thought this possibility through. Maybe you're right that it can be made to work.