[MacRuby-devel] [MacRuby] #816: Assertion fails on multi-threaded code
MacRuby
ruby-noreply at macosforge.org
Wed Jul 28 17:38:52 PDT 2010
#816: Assertion fails on multi-threaded code
------------------------------+---------------------------------------------
Reporter: mootoh@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: minor | Milestone:
Component: MacRuby | Keywords:
------------------------------+---------------------------------------------
I tried the following simple multi-threaded code snippet on MacRuby 0.6
(release build, obtained from http://www.macruby.org/downloads.html,
universal-darwin10.0, x86_64), and it aborted with following assertion:
{{{
Assertion failed: ((b->flags & flags) == flags), function
rb_vm_prepare_block, file dispatcher.cpp, line 1773.
}}}
Code snippet to reproduce this issue:
{{{
N=2
M=1000000
def compute_intensive n
r = 0
M.times do |i|
M.times do |j|
r = i * j + n
end
end
r
end
threads = []
N.times do |i|
th = Thread.new do
compute_intensive i
end
threads.push th
end
threads.each { |thread| thread.join }
}}}
I tried both ruby 1.8.7 (2009-06-12 patchlevel 174) and ruby 1.9.2dev
(2009-08-30 trunk 24718), and those produced no error.
--
Ticket URL: <http://www.macruby.org/trac/ticket/816>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list