forked from jruby/jruby
-
Notifications
You must be signed in to change notification settings - Fork 0
DifferencesBetweenMriAndJruby
jmhodges edited this page Jan 21, 2011
·
10 revisions
Although ideally MRI and JRuby would behave 100% the same in all situations, there are some minor differences. Some differences are due to bugs, and those are not reported here. This page is for differences that are not bugs.
- Native C extensions
- Continuations
- Invoking external processes
- Fork is not implemented
- Native Endian is Big Endian
- Time precision
- Regular expressions
- Thread priority
Example:
> Time.now.usec
=> 582000
Keep this in mind when counting on usec precision in your code.
ruby-1.8.7-p302 > "a".match(/^(.*)+$/)[1]
=> "a"
jruby-head > "a".match(/^(.*)+$/)[1]
=> ""
In JRuby, Threads are backed by Java threads, and the priority ranges from 1 to 10, with a default of 5. If you pass a value outside of this range to Thread#priority=, the priority will be set to 1 or 10.
(See http://bugs.jruby.org/5289 and http://bugs.jruby.org/5290.)