Archive for the 'JRuby' Category

Ruby in a multicore world

« 31 October 2009 | 17:17 | patterns/idiom/style, JRuby | 1418 Comments »

While the Ruby 1.8 and 1.9 internal threading models differ significantly, the exposed concurrency model is fundamentally the same. Unlike Ruby 1.8, Ruby 1.9 threads do map to native threads, unfortunately the 1.9 interpreter forces user created threads to acquire a global mutex lock before executing. The upshot is that 1.9 thread execution […]



Objects, Classes, and JRuby Internals

« 12 October 2007 | 8:56 | JRuby, Ruby Internals | 3 Comments »

A walk through of the JRuby implementation wraps up this series on Ruby internals and Singleton classes.
JRuby is a Java implementation of the Ruby interpreter. That is to say, that one can write plain ol’ Ruby files and hand them off to the JRuby interpreter for execution in the same way that […]



Real Class

« 28 September 2007 | 8:23 | Smalltalk, JRuby, Ruby Internals, MRI | 5 Comments »

It interesting that Ruby, a language which allows you to so easily bypass encapsulation, encapsulates it’s own internals to the point of occasional prevarication. Heres an example…

pirate = Object.new
def pirate.speak
“Yarrrr”
end
pirate.class == Object.new.class
#=> true

In my last post I explained how the code above forces the interpreter to assign a newly created Singleton class to the […]