threadA = Thread.new do
i = 0
loop do
puts "Thread A: #{i += 1}"
sleep 0.5
Thread.pass end end
threadB = Thread.new do
i = 0
loop do
puts "Thread B: #{i += 1}"
sleep 0.5
Thread.pass end end
threadC = Thread.new do
i = 0
loop do
puts "Thread C: #{i += 1}"
Thread.stop end end