Get the latest tech news

Ruby “Thread Contention” Is Simply GVL Queuing


“Thread Contention” is simply GVL Queuing There’s been a ton of fantastic posts from Jean Boussier recently explaining application shapes, instrumenting the GVL (Global VM Lock), and thoughts on removing the GVL. They’re great reads! For the longest time, I’ve misunderstood the phrase “thread contention”.

The dreaded “Tail Latency” of multithreaded behavior can happen, related to the Ruby Thread Quantum, when you have what might otherwise be a very short request, for example: A request that could be 10ms because it’s making ten 1ms calls to Memcached/Redis to fetch some cached values and then returns them (IO-bound Thread) A request that takes 1,000ms and largely spends its time doing string manipulation, for example a background thread that is taking a bunch of complex hashes and arrays and serializing them into a payload to send to a metrics server.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of ruby

ruby

Photo of thread contention

thread contention

Related news:

News photo

Rubywm: An X11 window manager in pure Ruby

News photo

Demodesk (YC W19) Is Hiring a Ruby on Rails Full-Stack Engineer

News photo

A visual demo of Ruby's lazy enumerator