malongshuai / malongshuai.github.io

2 stars 0 forks source link

Ruby 3多线程并行:Ractor | 骏马金龙 #233

Open malongshuai opened 2 years ago

malongshuai commented 2 years ago

https://www.junmajinlong.com/ruby/ruby_ractor/

回到Ruby系列文章 Ruby 3多线程并行:Ractor Ruby 3 Ractor官方手册:https://github.com/ruby/ruby/blob/master/doc/ractor.md 在Ruby 3之前,使用Thread来创建新的线程,但这种方式创建的多线程是并发而非并行的,MRI有一个全局解释器锁GIL来控制同一时刻只能有一个线程在执行: 1234567# main