python多线程资源分配
时间: 2023-09-22 11:04:51 浏览: 111
python多线程
Python的多线程机制确实有一些奇特之处。虽然现代计算机CPU物理核心较多,我们常常使用多线程技术来提高程序运行效率,但在Python中,在任何时刻只会有一个线程在执行。这是因为Python解释器有一个全局解释器锁(Global Interpreter Lock,GIL),它负责Python解释器的线程安全,保证同时只有一个线程在执行字节码。因此,尽管有多个物理核心,但多线程的程序并不会真正实现并行执行。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Python多线程详解](https://blog.csdn.net/qq_38236620/article/details/127474040)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [python多线程详解(超详细)](https://blog.csdn.net/m0_67900727/article/details/123399522)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文