From: Mark Hahn Date: 2001-12-20T16:22:02+09:00 Subject: [ruby-talk:29079] Re: A Ruby programmer walked into a bar and ordered a Ruby-Thread Never mind. I verified your result in my own Cygwin. It is good news that it works in mswin32. So saying it has problems in windows in incorrect. It only happens in cygwin. -----Original Message----- From: Mark Hahn [mailto:mchahn@facelink.com] Sent: Wednesday, December 19, 2001 11:10 PM To: ruby-talk ML Subject: [ruby-talk:29078] Re: A Ruby programmer walked into a bar and ordered a Ruby-Thread How do you know it hangs up in the sleep statement? The "Thread.critical = true" staement looks a might bit suspicious to me. -----Original Message----- From: dave@thomases.com [mailto:dave@thomases.com]On Behalf Of Dave Thomas Sent: Wednesday, December 19, 2001 9:39 PM To: ruby-talk ML Subject: [ruby-talk:29071] Re: A Ruby programmer walked into a bar and ordered a Ruby-Thread "Mark Hahn" writes: > In this situation, correct behaviour if for the higher priority thread to > run all the time and the lower one to never run. At any moment whichever > requesting thread has higher priority should be running. For example: Thread.current.priority = 10 c1 = 0 a = Thread.new { Thread.stop; loop { c1 += 1 }} a.priority = Thread.current.priority - 2 # a lower priority a.wakeup sleep 1 Thread.critical = true p c1 Unfortunately, under Linux, it reports a count, as it does with the MSWin32 Ruby. Under Cygwin on my box, it loops forever, with the main thread sitting in the sleep. Threads should work, and with consistent cross-platform semantics. The fact that they don't is a bug that as a community we need to address. Dave