TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Python GIL removal question

85 pointsby spahlalmost 14 years ago

8 comments

runT1MEalmost 14 years ago
&#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 未加载
pnathanalmost 14 years ago
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 未加载
akleinalmost 14 years ago
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>
ulrichalmost 14 years ago
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 未加载
br1almost 14 years ago
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?
yasonalmost 14 years ago
<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 未加载
kev009almost 14 years ago
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_venturealmost 14 years ago
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 未加载