[MacRuby-devel] [MacRuby] #597: Dispatch Queue async method inconsistent results

MacRuby ruby-noreply at macosforge.org
Wed Feb 3 10:09:21 PST 2010


#597: Dispatch Queue async method inconsistent results
--------------------------------------+-------------------------------------
 Reporter:  Knut.Olaf.Lien@…          |       Owner:  ernest.prabhakar@…        
     Type:  defect                    |      Status:  new                       
 Priority:  blocker                   |   Milestone:                            
Component:  MacRuby                   |    Keywords:  GCD async method          
--------------------------------------+-------------------------------------

Comment(by ernest.prabhakar@…):

 Well, it works for q.sync, which is a good sign:

 8.times {|i| q.sync {result[i] = fib(i)}}

 And it works for me (on the latest trunk) with q.async:
 8.times {|i| q.async {result[i] = fib(i)}}
 q.sync {}

 But, I do get odd behavior with async(grp).

 8.times {|i| q.async(grp) {result[i] = fib(i)}}

 grp.wait
 p result => [nil, 1, 1, 2, 3, 5, 8, 13]

 Hmm.

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/597#comment:2>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list