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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Python GIL removal question

85 点作者 spahl将近 14 年前

8 条评论

runT1ME将近 14 年前
&#62;That is, if one processor writes to memory in a cache-line shared by another processor, they must stop whatever they are doing to synchronize the dirty cache lines with RAM. Thus, updating reference counts would flood the memory bus with traffic and be much worse than the GIL.<p>I dont' understand. Isn't this going to happen if you have multiple threads running even <i>if</i> the GIL is blocking them from running? I'm not a hardware expert, but I'm not sure how constant locking would prevent cache synchronization just because they weren't truly running in parallel.<p>I am fairly certain that constant synchronization(lock) because of the GIL would negatively impact cache performance, especially since well designed multithreaded applications avoid locking for as long as possible.
评论 #2878383 未加载
评论 #2878604 未加载
pnathan将近 14 年前
I find it terribly annoying when the solution to a language problem is "Write an extension". It's a cop-out.<p>Java, .NET, various Lisps, and I'm sure other systems that I don't know off the top of my head have solved the problem of true threading.
评论 #2879000 未加载
评论 #2879256 未加载
aklein将近 14 年前
Can anyone shed light on where the GIL winds up hurting you?<p>According to this paper [1]: "Thus, in all cases, the single global lock semantics seem fundamentally compatible with both lock-based and transactional memory implementations."<p>[1] <a href="http://www.usenix.org/event/hotpar09/tech/full_papers/boehm/boehm_html/" rel="nofollow">http://www.usenix.org/event/hotpar09/tech/full_papers/boehm/...</a>
ulrich将近 14 年前
If you leave aside C-extensions and libraries, CPython is a pretty bad language for number crunching. This is just not the use-case it tries to solve. I am glad they favor simplicity over execution speed.<p>Removing the GIL might be useful for a faster implementation with JIT compiler though.
评论 #2879377 未加载
评论 #2879439 未加载
br1将近 14 年前
Reference counts could be stored separately from objects and migrated to the thread that modified it. Or several reference counts for the same object could be used. Has this been tried?
yason将近 14 年前
<i>If the GIL bites you, it's most likely a warning that your program is badly written, independent of the GIL issue.</i><p>Ah, that old line again.<p>Translation: <i>"We really don't like to even think about changing this crappy design that we started with in the first place, because we can just explain ourselves out of it by coming up with suitable language goals that don't actually require concurrent access to the interpreter. Not accessing the interpreter concurrently is one of our language goals because you can do </i>everything else<i>. So, if you think you still need to get rid of GIL then you're just a bad programmer and your programs are badly written because hey, we just defined the universe you're playing in."</i>
评论 #2880705 未加载
kev009将近 14 年前
Sounds like typical denial a la Firefox memory usage or MySQL's early lacking that have to get eaten down the line.<p>Not that the case isn't well argued, but to claim that GIL isn't a fundamental limitation and a bad thing is silly.<p>A few years from now it will be like, "Oh, yeah.. that".
评论 #2878616 未加载
评论 #2878529 未加载
评论 #2878663 未加载
评论 #2878509 未加载
评论 #2878631 未加载
thadeus_venture将近 14 年前
The most frustrating thing about Python is its community's complete denial about what a joke their concurrency situation is. Truth is python is not truly multi-threaded, and no, claiming that multi-process is the way to do parallel computation across the board is not a sane argument at all. It's religious zeal. My company is currently using it for web apps, and that's proving a pain (i.e. having to use proxy servers for database access to minimize connections across all the python process instances). Using python for anything more serious, like a message queuing system for example is even more prohibitive. People in charge should wake up and start taking serious steps about it. I guess PyPy is the biggest hope. Meanwhile in the JVM world..
评论 #2878693 未加载
评论 #2878638 未加载