fork download
  1. a = 1
  2. Thread.new(a) { |a| puts a; sleep 1; puts a}
  3. sleep 0.2
  4. a=2
  5. Thread.new(a) { |a| puts a; sleep 1; puts a}
  6. sleep 2
Success #stdin #stdout 0.02s 9544KB
stdin
Standard input is empty
stdout
1
2
1
2