2
當我運行一個Ruby程序時,解釋器創建兩個線程而不是一個線程。紅寶石。兩個線程而不是一個
這裏的示例程序:
# example.rb
sleep 60
而且that是以下命令的工作結果:
watch -ctn1 'ps -T -eo cmd,pid,nlwp,lwp | grep "ruby example.rb" | grep -v "grep"'
爲什麼Ruby的行爲這樣的方式?
謝謝。
Debian GNU/Linux 6.0.1;
Ruby 1.9.2。