[TxMt] errant rubymate output when dealing with threads

jeanpierre at gmail.com jeanpierre at gmail.com
Sun Nov 19 01:23:34 UTC 2006


i am seeing some strange rubymate output when working with threads -
at times text is not printed on separate lines (when using puts rather
than print) and at others, the text is not printed at all. any
suggestions to resolve the rubymate behavior or pointers to where i
could?

regards,
jean-pierre



sample 1:
  mate = Thread.new do
    puts "Ahoy! Can I be dropping the anchor sir?"
    Thread.stop
    puts "Aye sir, dropping anchor!"
  end
  Thread.pass
  puts "CAPTAIN: Aye, laddy!"
  mate.run
  mate.join

output from rubymate:
  Ahoy! Can I be dropping the anchor sir?CAPTAIN: Aye, laddy!

  Aye sir, dropping anchor!

expected output:
  Ahoy! Can I be dropping the anchor sir?
  CAPTAIN: Aye, laddy!
  Aye sir, dropping anchor!


sample 2:
  homicide = Thread.new do
    while true
      puts "Don't kill me!"
      Thread.pass
    end
  end
  suicide = Thread.new do
    puts "This is all meaningless!"
    Thread.exit
  end
  Thread.kill(homicide)

output from rubymate:
  <nothing>

expected output:
  Don't kill me!
  This is all meaningless!
  Don't kill me!



More information about the textmate mailing list