Threads in rubinius

31 views
Skip to first unread message

Twin Primes

unread,
Nov 16, 2010, 12:50:03 AM11/16/10
to rubinius-dev
Hi,

Just downloaded, and tried rubinius. Threads seem to be running rather
slowly. Do I need
to set some config option to get threads to run at full speed ? (The
way I can tell is that the
CPU monitors for my 2 cores jump from 800MHz to 1.6GHz but not to the
full 2.2GHz; JRuby
does seem to run the threads at full speed).

My program creates 2 slave threads and sends CPU intensive tasks to
them from the main
thread.

Thanks for any insight.

Chuck Remes

unread,
Nov 16, 2010, 9:14:45 AM11/16/10
to rubini...@googlegroups.com

It would be best if you could share the code in question.

Without knowing exactly what you are doing, I can only guess. I *guess* that your threads are I/O bound. If they are blocking on I/O then you won't see a CPU spike.

Show us the code or come visit in IRC again. Alternately, run your program with -Xprofile -Xprofiler.graph and put the results in a pastie/gist.

cr

Tony Arcieri

unread,
Nov 16, 2010, 11:56:12 AM11/16/10
to rubini...@googlegroups.com
On Mon, Nov 15, 2010 at 10:50 PM, Twin Primes <amber...@gmail.com> wrote:
JRuby
does seem to run the threads at full speed).

My program creates 2 slave threads and sends CPU intensive tasks to
them from the main
thread.

Rubinius has a Global Interpreter Lock which prevents two threads from executing Ruby code concurrently. JRuby does not.

This is going to be removed in a future version of Rubinius.
 
--
Tony Arcieri
Medioh! A Kudelski Brand

Chuck Remes

unread,
Nov 16, 2010, 12:38:04 PM11/16/10
to rubini...@googlegroups.com
Geez, I forgot about this. I've been playing with the hydra branch (GIL is removed) and forgot it wasn't the master that everyone else is using. Oops.

cr


Reply all
Reply to author
Forward
0 new messages