From: Daniel Merk Date: 2008-08-20T00:22:44+09:00 Subject: Newly created thread blocks all others in Ruby 1.8.7 patchlevel 72 on Cygwin ------=_Part_11399_31791636.1219159567677 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello together, I am using the following Ruby version: ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin] I have problems with threads now that did not occur in Ruby 1.8.6. I execute the following code (derived from an example in the Ruby core documentation): require 'thread' count1 = count2 = 0 puts "starting thread a" a = Thread.new do loop { count1 += 1 } end a.priority = -1 puts "starting thread b" b = Thread.new do loop { count2 += 1 } end b.priority = -2 sleep 1 #=> 1 Thread.critical = 1 puts "count1: #{count1}" puts "count2: #{count2}" This code never starts thread b. It seems that thread a blocks all other threads once it runs (though its priority is lowered), even the main thread. If I put a sleep command into the thread a loop, thread b starts, but the problem remains, since then thread b blocks all others from running. The Ruby 1.8.7 release notes speak of a change in the mutex implementation in C. Could that be a problem? Thanks for any help Daniel ------=_Part_11399_31791636.1219159567677--