News for hackers. Stuff that matters.
Re:Ruby 3, Concurrency and the Ecosystem by ramchip on Saturday January 09, 2021 @05:17AM (#25699152)
A lot of web services do a little bit of work, wait on a DB query, do a little bit of work, wait on DB, etc. It’s even more true with websockets, which spend most of their time idle waiting for messages.

Good concurrency support lets you handle thousands (even millions) of these activities in a single process, which is massively more efficient than using a process each, and puts less load on other systems (DB, Splunk, Graphite, RabbitMQ…)

Green threads in particular make it possible to get these benefits without writing the code in async style. You just write regular, blocking code and the runtime / frameworks take care of yielding to the scheduler (event loop) when appropriate.

There are no comments on this comment yet.