TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Understanding the Python GIL (Pycon 2010 Slides)

34 点作者 r11t超过 15 年前

5 条评论

cpr超过 15 年前
Isn't this just a good argument for event-based programming ala Twisted or Node.js, to avoid the system thread overheads altogether?<p>It seems to me that programming with event-based frameworks like Node.js is much less fraught with peril, confusion, and error.<p>(Having written a couple of small but complete (bare iron) real-time, thread/process-based operating systems (and applications for them) for workstation-class CPUs back in the 80's, I'm highly aware of the peril and confusion possible. ;-)
评论 #1139873 未加载
mgedmin超过 15 年前
Attempting the slide 3 example on a dual-core Core 2 Duo CPU running 32-bit Linux with Python 2.6 I get<p><pre><code> * single-threaded: 8.9s * two threads: 10.4s </code></pre> Overhead is ~17% (compare to 2X slowdown reported on quad-core Mac OS X). Interesting.
评论 #1139472 未加载
评论 #1139389 未加载
bockris超过 15 年前
The talk was FANTASTIC. Hopefully the video will be up soon.
评论 #1139387 未加载
crad超过 15 年前
I was fortunate enough to attend this talk. It was quite an eye-opener as far as how wonky thread performance is. The overall equation seems to be something like:<p><pre><code> # of threads * # of cores == context switch storm density. </code></pre> David was clear to say that his presentation was not to discourage people from using threads.<p>The take-away for me are to really pay attention to implementation of my thread usage and to see if linux processor affinity would help in a situation where you control all the threads in your app.<p>The upcoming changes to the GIL for 3.2 has a dramatic impact on stability of behavior in threading but a negative impact on IO threads, which they are planning on addressing.
评论 #1139521 未加载
zach超过 15 年前
And it's typeset in Gill!<p>Did anyone who went to his Open Space session have a report?