4 ms·
Translated into simple language, Ruby chose to expose the multithreading paradigm (multple threads over shared data), like Java and others. Multithreading is s
by downsplat 2y ago
Translated into simple language, Ruby chose to expose the multithreading paradigm (multple threads over shared data), like Java and others.
Multithreading is strictly more powerful than single threaded event loops. For some kinds of software there is just no alternative - a modern browser engine for example needs to be multithreaded.
The trade off is that you need to make sure your code is thread safe, which is not trivial as the collection of articles explains. That's your function color right there, green functions are verified thread safe, gray functions are not or not sure.
Personally in nearly 30 years of programming I've never needed to write multithreaded code. I still haven't found a business need that could not be met with suitable choices between multiprocessing (i.e fork) and event loops.
I'll definitely take wait/async programming over having to worry about concurrent thread safety any day of the week.