时间:20171226
python 最新版本:3.6.4
信息来自python官网:
CPython implementation detail: In CPython, due to the Global Interpreter Lock, only one thread can execute Python code at once (even though
certain performance-oriented libraries might overcome this limitation). If you want your application to make better use of the computational resources
of multi-core machines, you are advised to use multiprocessing or concurrent.futures.ProcessPoolExecutor. However, threading is still an appropriate
model if you want to run multiple I/O-bound tasks simultaneously.
大意:
由于全局解释器锁,每次只有一个线程执行python代码(即使对此限制进行了优化),如果要使你的应用在多核机器上计算性能更好,
建议使用多进程或并发进程池。尽管如此 python线程仍然合适运行多I/O任务