19 Mar '13, 5am

JRuby Basics and compatibility with MRI - RailsCasts:

Here we have a simple method for calculating Fibonacci numbers that we trigger five times, each in a separate thread and when the program has finished we print out the total time it took to run. When we run this under JRuby it takes under a second to complete, but if we switch Ruby versions and run the same program under MRI it takes over three seconds. The main reason for this slowdown is the Global Interpreter Lock. Matt Aimonetti wrote an article about this in 2011 which explains this in detail. Basically this lock prevents the Fibonacci sequence from running concurrently in separate threads and if we have a multi-core machine this time difference will be more noticeable. If we aren’t constantly processing Ruby code, but are instead waiting for a response from a database or a file system then the GIL is lifted an we can simulate this will a call to

Full article: http://railscasts.com/episodes/376-jruby-basics?view=asci...


Think you know the basics? #WhatisNATO

nato.int 21 Mar '13, 10am

NATO’s essential purpose is to safeguard the freedom and security of its members through political and military means. POL...