网络编程之多线程——GIL全局说明器锁
一、引子
定义:
In CPython, the global interpreter lock, or GIL, is a mutex that prevents multiple
native threads from executing Python bytecodes at once. This lock is necessary mainly
because CPython’s memory management is not thread-safe. (However, since the GIL
exists, other features have grown to depend on the guarantees that it enforces.)
结论:在Cpython说明器中,同一个进程下开启的多线程,同一时刻只能有一个线程履行,没法应用多核优势定义:
In CPython, the globa