From: Jens Nissen Date: 2002-01-10T18:42:33+09:00 Subject: Severe issue with two Threads and load and eval I have trouble with executing load and eval in two concurrent Ruby Threads. The code from 'eval' is appended to the file loaded and a Syntax error appears in the thread executing 'load'. (Environment is Ruby 1.6.6./mswin32/Windows2K) It's easy to reproduce: Skript1: #Beginning of Skript 1 Thread.new { while true eval "puts 'Hallo'" Thread.pass end } 1000.times do |i| a = i load "e.rb" end #End of Skript 1 The file loaded named "e.rb" is empty - but you may fill it with something short. The ouput is the following: ------------------------------------------ ruby 1.6.6 (2001-12-13) [i586-mswin32] Hallo Hallo :11:in `load': ./e.rb: syntax error (SyntaxError) puts 'Hallo' ^ from :11 from :9:in `times' from :9 Tool completed with exit code 1 ------------------------------------------ How can I work around this? I have absolutely no idea what is going wrong, as I do not really understand the compiler!