From: Robert Feldt Date: 2000-10-22T13:06:32+09:00 Subject: [ruby-talk:5747] Q on Queue Hi, I just started looking at Ruby's thread support so I might be missing something vital but: * In Queue#push: 1 def push(obj) 2 Thread.critical = true 3 @que.push obj 4 begin 5 t = @waiting.shift 6 t.wakeup if t 7 rescue ThreadError 8 retry 9 ensure 10 Thread.critical = false 11 end 12 t.run if t 13 end does anything prevent the scheduler from scheduling a thread t2 that are waiting after t1 (that have been waked up and is about to be run) so that it gets the next object in the queue before t1? That is: @waiting = [t1,t2] push o1 wakes up t1 interrupted at line 11 push o2 wakes up t2 t2 pops o1 t1 pops o2 Regards, Robert