首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

PyQt中运用QThread是不是真正的多线程啊

2013-08-09 
PyQt中使用QThread是不是真正的多线程啊????据说Python由于GIL的原因其本身不具有真正的多线程功能,也就是

PyQt中使用QThread是不是真正的多线程啊????
据说Python由于GIL的原因其本身不具有真正的多线程功能,也就是即使使用了threading模块编写了多线程代码,在多核处理器上执行也只能使用一个核,并不能提高速度,甚至在极端的情况下比单核处理器上执行更慢

那么如果使用PyQt中的Qt线程模块QThread编写多线程程序,此时还会受GIL限制吗??? Python Qt
[解决办法]
在这儿(http://stackoverflow.com/questions/1595649/threading-in-a-pyqt-application-use-qt-threads-or-python-threads)有人提到:

“And some earlier comment on this subject from PyQt's author: "they are both wrappers around the same native thread implementations". And both implementations use GIL in the same way.”

所以pyqt的thread也受GIL的限制。

热点排行