Python 3.1中的GIL [英] GIL in Python 3.1

查看:66
本文介绍了Python 3.1中的GIL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道Python 3.1中针对C ++多线程集成的Global Interpreter Lock的命运吗?

Does anybody knows fate of Global Interpreter Lock in Python 3.1 against C++ multithreading integration

推荐答案

GIL在CPython 3.1中仍然存在; Unladen Swallow 项目旨在(在许多其他性能提升中)最终将其删除,但是这仍然是实现其目标的一种方法,并且首先在2.6上进行开发,目的是最终移植到3.x,以便在完成2.y版本之前将x转换为当前版本.就目前而言,多处理(而不是线程化)仍然是在CPython中使用多个内核的选择方式(IronPython和Jython也很好,但是它们目前不支持Python 3,也不能使C ++集成变得如此容易;- ).

GIL is still there in CPython 3.1; the Unladen Swallow projects aims (among many other performance boosts) to eventually remove it, but it's still a way from its goals, and is working on 2.6 first with the intent of eventually porting to 3.x for whatever x will be current by the time the 2.y version is considered to be done. For now, multiprocessing (instead of threading) remains the way of choice for using multiple cores in CPython (IronPython and Jython are fine too, but they don't support Python 3 currently, nor do they make C++ integration all that easy either;-).

这篇关于Python 3.1中的GIL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆