r/ruby • • 2d ago

Question GVL and concurrent programming

Ruby cannot perform real concurrent processing on multicore microprocessors without using ractors because of the GVL. It will only simulate multiple simultaneous processes with threads, queues, mutexes, etc. in a single processor core, no true parallel processing. How does this limitation affect true parallel programming in Ruby, that is, how much more complicated is it in producing true multicore parallel programming? I am still working on learning Ruby and this is part of my self-inflicted learning process in parallel with Huw Collingworth Book of Ruby.

9 Upvotes

27 comments sorted by

View all comments

1

u/KevinSaison 1d ago

Concurrency and parallelism are not the same thing.
Concurrency is primarily about structuring work.
Parallelism is about executing work simultaneously.
Thread safety is about ensuring that simultaneous or interleaved work doesn't corrupt your program.

1

u/Edthal01 1d ago

As an intellectual activity, either would do for me, but I think I'll start simple: concurrency.