我怎么能杀平(或其他非常LONGEST没有超时和等系统进程)(平 - 它只是简单的例子)在红宝石主题:杀系统进程
a = Thread.new do
system 'ping localhost'
end
a.kill
a.exit
a.terminate
while true
sleep 5
p a.alive?
end
输出:=>
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_req=1 ttl=64 time=0.023 ms
....
true
64 bytes from localhost.localdomain (127.0.0.1): icmp_req=7 ttl=64 time=0.022 ms
.....
true
......
所以我需要停止与线程的ping进程,但我不知道该怎么做。
你可以看看到GEM [神](http://godrb.com/) –