From: Mark Hahn Date: 2001-12-20T11:42:12+09:00 Subject: [ruby-talk:29050] Re: A Ruby programmer walked into a bar and ordered a Ruby-Thread >without the sleeps, but with priorities set differently 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. Have you ever worked with prioritized interrupts? A lower priority interrupt NEVER interrupts a higher priority task. This is the same with threads. -----Original Message----- From: dave@thomases.com [mailto:dave@thomases.com]On Behalf Of Dave Thomas Sent: Wednesday, December 19, 2001 5:34 PM To: ruby-talk ML Subject: [ruby-talk:29046] Re: A Ruby programmer walked into a bar and ordered a Ruby-Thread "Mark Hahn" writes: > I don't understand the problem. I just ran this on windows: > > Thread.new {loop{print 'a';sleep(0.1)}} > Thread.new {loop{print 'b';sleep(0.214)}} > sleep(2) Try it without the sleeps, but with priorities set differently. Under Unix, and with big enough loop values, the threads will loop in accordance with their priorities. Under Windows, one gets exclusive control. Dave