参考:
Python GIL 系列之通过实例认识Python的GIL
Python GIL 系列之再谈Python的GIL
概述
本文通过对比测试来证明下单线程、多线程、多进程的‘并发‘计算能力
测试
测试程序
from threading import Thread
from timeit import Timer
from multiprocessing import Process
G_COUNT = 100000000
G_THREAD_COUNT = 2
G_PROCESS_COUNT = 2
def count