From: Dave Thomas Date: 2008-02-10T13:19:38+09:00 Subject: Synced IO seems not to be thread-safe Take the following code: STDOUT.sync = true threads = (1..4).map do |number| Thread.new(number) do |i| print "#{i}\n" end end threads.each { |t| t.join } Run like this: ruby t.rb >t.op And inspect the output $ od -c t.op 0000000 2 \n 0000002 You get something different every time :) dave[RUBY3/Book 22:18:25] ruby t.rb >t.op dave[RUBY3/Book 22:18:26] od -c t.op 0000000 2 \n \0 \0 4 \n 0000006 Without the STDOUT.sync, the problem goes away. Dave