美文网首页
python GIL

python GIL

作者: michael_0x | 来源:发表于2024-01-05 20:05 被阅读0次

今天跑python多线程出了个奇怪的crash:
Fatal Python error: PyThreadState_Get: the function must be called with the GIL held, but the GIL is released (the current Python thread state is NULL)

找到如下参考:
https://superfastpython.com/thread-race-condition-shared-variable/
https://realpython.com/python-parallel-processing/
https://www.jianshu.com/p/573aaa001b35

然后研究了半天,发现是有个线程因为崩溃,导致了这个问题,然后崩溃的log也没有打出来,还以为是GIL的问题。

迫使自己看了下GIL,又多了解一个python的限制了。

相关文章

  • Python day28_GIL 深拷贝浅拷贝

    GIL(全局解释器锁) GIL面试题如下 描述Python GIL的概念, 以及它对python多线程的影响?编写...

  • GIL

    一,GIL的概念 python全局解释器锁。 二,GIL产生的原因 GIL 并不是 Python 语言的特性,它是...

  • 线程安全,GIL全局锁

    1. GIL是什么? GIL不是Python特性GIL是实现Python解释器(Cpython)时引入的概念,而C...

  • Python高级语法1:GIL锁&浅拷贝&深拷贝

    一、GIL锁 1.1、GIL面试题:描述Python GIL的概念, 以及它对python多线程的影响?编写一个多...

  • python入门系列:多线程

    python中的GIL GIL(Global Interpreter Lock),就是一个锁。 Python中的一...

  • python中的GIL详解

    原文链接 GIL并不是Python的特性,Python完全可以不依赖于GIL。 ​ GIL 锁: 全局解释器锁,作...

  • python之理解GIL

    python之理解GIL 1、GIL简介 GIL的全称为Global Interpreter Lock,全局解释器...

  • 008 12. python提高-1

    12.1. GIL GIL(全局解释器锁) GIL面试题如下 描述Python GIL的概念, 以及它对pytho...

  • python多线程

    python基础之多线程锁机制 GIL(全局解释器锁) GIL并不是Python的特性,它是在实现Python解析...

  • Python GIL 和 Flask

    GIL: 多线程反而更慢 Python有个GIL ( Global Interpreter Lock ), 使得同...

网友评论

      本文标题:python GIL

      本文链接:https://www.haomeiwen.com/subject/lopindtx.html