4 ms·
To be even more pedantic, python already runs on multiple cores. They poll the GIL until they can run. I believe some version of Python 3 fixes this behavior
by j_baker 14y ago
To be even more pedantic, python already runs on multiple cores. They poll the GIL until they can run. I believe some version of Python 3 fixes this behavior so they don't have to poll the GIL.
- Peaker 14y agoThe GIL is not a spinlock. Since only one core gets the GIL at a time, it's still just using one core (even if that one core is being switched around). The GIL is released during the execution of some C code, so another thread may execute Python code in the meantime, but that's probably besides the point too.
- willvarfar 14y agoAs we are in the <pedantic> sub-thread, we can point out that actually a Python process can use more than one core at the same time, just trying to acquire the GIL. This is how Python programs can show up using more than 100% CPU in `top`. http://blip.tv/pycon-us-videos-2009-2010-2011/pycon-2010-understanding-the-python-gil-82-3273690 http://blip.tv/pycon-us-videos-2009-2010-2011/pycon-2010-und... covers this