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.

10 Upvotes

27 comments sorted by

View all comments

Show parent comment

1

u/Edthal01 2d ago

As a learner that seems the way for me to go.

1

u/andrevan 2d ago

i use em in production!

1

u/azimux 2d ago

Fibers are fun to learn/use but if you're specifically interested in true concurrency, then it's probably worth mentioning that fibers don't offer true concurrency. That is, they're good for IO-bound work but not CPU-bound work. So just depends on what you're up to or what you're interested in learning about.

1

u/Edthal01 2d ago

I don't need to think about more than 1 core, just how to learn about concurrent processes.