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.

Concurrency is a Myth in Ruby (and Python)

29 pointsby igrigorikover 16 years ago

8 comments

neilcover 16 years ago
The title is trollish: <i>concurrency</i> is not a "myth" in either Ruby or Python -- you just need to use the appropriate techniques (process-level parallelism, non-blocking I/O, etc.) to achieve it. The existence of the GIL is well-known.
etalover 16 years ago
GvR gave an interesting answer on Google's "Ask an Engineer" app, to a question about adapting Python to multi-core architectures:<p><a href="http://moderator.appspot.com/#15/e=c9&#38;t=ff&#38;q=2f40&#38;v=4" rel="nofollow">http://moderator.appspot.com/#15/e=c9&#38;t=ff&#38;q=2f40&#3...</a><p>His answer: threading is not worth it, and something Actor-like built on top of the new multiprocessing module should be written eventually. (Pythonic, no?)
scott_sover 16 years ago
Concurrent programming in Python: <a href="http://docs.python.org/library/multiprocessing.html" rel="nofollow">http://docs.python.org/library/multiprocessing.html</a>
评论 #364003 未加载
评论 #363563 未加载
strlenover 16 years ago
There's other options beyond using JRuby for doing true multi-threading in a dynamic language. Perl has had true threading support (perldoc threads, perldoc perlthrtut) for a while now.<p>I agree that for most cases non-blocking I/O and select()/epoll() makes more sense, but there are cases where true concurrency (threading or multiple processes) is needed and either memory needs to be explicitly shared (IPC is too costly/complex or memory requirement is high) or the cost of spawning a new process is prohibitive (you're dealing with an SLA).
pdubroyover 16 years ago
I actually think this is a good thing.<p>Writing (correct) multi-threaded programs is actually really hard to do. The underlying philosophy of both Ruby and Python is that the programmer's time is more important than the computer's. Using multiple processes instead of threads may require slightly more memory and computation time, but the programmer will spend less time debugging.
评论 #363726 未加载
thomasmallenover 16 years ago
Stackless Python?
评论 #366103 未加载
twismover 16 years ago
Concurrency in javascript: <a href="http://www.mozilla.org/rhino/scopes.html" rel="nofollow">http://www.mozilla.org/rhino/scopes.html</a>
samuelover 16 years ago
At least in Python, most C coded modules release the lock so asynchronous I/O is possible.