From: Michael Malone Date: 2009-03-09T11:05:58+09:00 Subject: Re: 1.9.x Thread problem Nobuyoshi Nakada wrote: > Hi, > > At Mon, 9 Mar 2009 09:25:06 +0900, > Michael Malone wrote in [ruby-talk:330697]: > >> If I run this using either ruby 1.9.1p0 (2009-01-30 revision 21907) >> [i686-linux] or ruby 1.9.2dev (2009-03-05 trunk 22769) [i686-linux] I >> get results I would not expect: >> Joining thread , n= >> > > It hasn't been defined which thread, the created child thread > or the creating parent thread, runs first at thread creation. > In 1.8, the child runs first by chance. > > Can you then explain why it runs consistently like this or a way in which I can guarantee I am running in the first created child thread? I would have expected to be inside of the child thread because the code setting up the :index is inside the block passed to Thread.new(). And I only put the created child Thread instances in the Queue, so I should _only_ get child Thread instances when I call Queue#pop. ======================================================================= This email, including any attachments, is only for the intended addressee. It is subject to copyright, is confidential and may be the subject of legal or other privilege, none of which is waived or lost by reason of this transmission. If the receiver is not the intended addressee, please accept our apologies, notify us by return, delete all copies and perform no other act on the email. Unfortunately, we cannot warrant that the email has not been altered or corrupted during transmission. =======================================================================