您的位置: 首页 > 文章 > Ruby多线程 Ruby多线程 分类: 文章 • 2022-07-21 22:30:09 1:Ruby多线程:main线程运行完后,会杀死其他线程,因此需要join进主线程,让主线程等待其他线程运行完后在结束 x = Thread.new do puts "start" sleep 2 puts "thread.." sleep 2 puts "end" end #主线程执行完后会杀死其他的线程 p "hello___" x.join