From: Daniel Berger Date: 2007-03-13T08:00:08+09:00 Subject: Re: Trying to make Array#collect massively parallel with OpenMP On Mar 12, 4:02 pm, "Jan Svitok" wrote: > On 3/12/07, Daniel Berger wrote: > > > Edit array.c and add the rb_ary_acollect function in my OP anywhere > > above the Init_array() declaration. Add "rb_define_method(rb_cArray, > > "acollect", rb_ary_acollect, 0);" where all the other method > > defintions are (near the bottom). Then recompile and install. > > > Thanks, > > > Dan > > Hi, > > as I wasn't able to compile 1.8.5-p12 I used the brand new 1.8.6 and > VS 2005 SP1, XP SP2. > > Patch to array.c is included and I added -openmp to CPPFLAGS. > Second run without assignments: > > W:\projects\ruby\ruby\ruby-1.8.6\win32>bench_collect.rb > user system total real > Array#collect 6.875000 0.047000 6.922000 ( 6.953000) > Array#acollect > W:/projects/ruby/ruby/ruby-1.8.6/win32/bench_collect.rb:17: [BUG] > cross-thread violation on rb_thread_schedule() > ruby 1.8.6 (2007-03-13) [i386-mswin32_80] Ouch. I had a feeling it would collapse. Maybe wrapping the relevant code in RUBY_CRITICAL would work, but that may defeat the purpose, assuming it even works at all. Oh, well. It was fun to try at least. :) Thanks, Dan