阅读背景:

python多线程在IO密集型情况下为什么会更快?

来源:互联网 

下面是Python 2.7.9手册中对GIL的简单介绍:
The mechanism used by the CPython interpreter to assure that only one thread executes Python bytecode at a time. This simplifies the CPython implementation by making the object model (including critical built-in types such as dict) implicitly safe against concurrent access. Locking the entire interpreter makes it easier for the interpreter to be multi-threaded, at the expense of much of the parallelism afforded by multi-processor machines. The mechanism




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: