有没有一种方法来分析python进程对GIL的使用?基本上,我想找出持有GIL的时间百分比。该进程是单线程的。
我的动机是我有一些用Cython编写的代码,使用nogil。理想情况下,我想在多线程进程中运行它,但是为了知道这是否可能是一个好主意,我需要知道GIL是否有大量时间空闲。
nogil
我从8年前就发现了这个相关问题。唯一的答案是“否”。希望此后一切都变了。
python multithreading profiling cython gil
cython ×1
gil ×1
multithreading ×1
profiling ×1
python ×1