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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ruby “Thread Contention” Is Simply GVL Queuing

97 点作者 ciconia3 个月前

7 条评论

Alifatisk3 个月前
I've started to use Ruby for mathematical and scientific computing using IRuby. I am not in need for high performance computing yet so Ruby is still sufficient. Oh boy what a joy it is to use.
评论 #42919784 未加载
评论 #42919789 未加载
taf23 个月前
If i'm reading this correctly for web applications setting RUBY_THREAD_DEFAULT_QUANTUM_MS=10 or maybe even RUBY_THREAD_DEFAULT_QUANTUM_MS=1 could be more optimal then the current default of 100, allowing for more throughput at the cost of potentially slower single shot response times?
评论 #42918991 未加载
评论 #42919862 未加载
评论 #42918960 未加载
mrinterweb3 个月前
Ben Sheldon, I really appreciate how you wrote this article. It feels like it was written in a very direct way that is more easily consumable for people who's attention tends to drift on long-form articles. I feel like you covered a complex topic succinctly, and I appreciate that. Helped me get a better understanding of thread contention. Thanks.
leosarev3 个月前
Intresting that this problem (IO-bound threads should have priority over CPU-bound threads) already solved at OS level (most OSes will give priority boost to thread that was unblocked because of end of IO operation in hope that thread will soon block with another operation).
amw-zero3 个月前
Loved this writeup, because queues are the most important and general concept in reasoning about performance. When you realize this, you start seeing them everywhere. Locks, async IO... everything is just interacting queues.
jeffbee3 个月前
This is what thread contention means in any language and runtime. Threads "contend" for mutexes by waiting.
评论 #42919801 未加载
评论 #42919222 未加载
loeg3 个月前
Yes, all contention is just queueing on shared resources...