File: threaddemo.rb

Project: Invitation to Ruby

#!/usr/bin/env ruby

t = Thread.new {
  10.times { |i|
    puts "HI (#{i})"
    sleep 0.2
  }
}

5.times { |i|
  puts "            LO (#{i})"
  sleep 0.1
}
t.join
puts "All Done"


[ Index ][ Table of Contents ]
Generated by [ source2html ]