About Me

My photo
PhD Candidate at Purdue University, Computer Science.
Showing posts with label jikes. Show all posts
Showing posts with label jikes. Show all posts

Tuesday, September 22, 2009

Unbiasing the biased thing

I think the title is quite interesting. For VMs guys the biased locking is a well known topic.
I read a post few months ago an entry about the impact of the biased implementation in Java 6, and to get full idea go quickly through the comments as well.
I liked to make the same experiment against the JikesRVM biased implementation which I am working on currently.
It was really interesting that I got a slightly different behavior than the same experiment running on Java6.
Java6:
It is always the same output, the first thread does all the work, and the other threads display zeros.
JikesRVM:
Every run, I get a different output: The following are examples of what I got as an output from the little experiment:
$runnable[0]: counter=4
runnable[1]: counter=0
runnable[2]: counter=0
runnable[3]: counter=0
runnable[4]: counter=987

Another one:
$runnable[0]: counter=5
runnable[1]: counter=498
runnable[2]: counter=488
runnable[3]: counter=0
runnable[4]: counter=0
Again:
$runnable[0]: counter=1
runnable[1]: counter=990
runnable[2]: counter=0
runnable[3]: counter=0
runnable[4]: counter=0
Ok, I promise this is the last one:
$runnable[0]: counter=117
runnable[1]: counter=875
runnable[2]: counter=0
runnable[3]: counter=0
runnable[4]: counter=0
I run the experiment on my Ia32_linux system and used exactly the same code in the same entry I refer to.
Although the JikesRVM is somehow far from being "fair", I think we are on business. The real question will be how we can increase this fairness without beating the performance of the biased mechanism, or how can we decrease the threads starvations and get the same performance we are aiming for from the biased implementation.
It worth mention that the current implementation beats Java6 in many benchmarks. Stay tuned with more entries about this.

Thursday, December 11, 2008

Back to Shell

Finally, I am back to the open source world.

After getting my new used Toshiba Satellite A100, I downloaded Ubuntu 8.10.
Something I liked when installing the new ubuntu is its ability to be installed within Windows. So, u don't have to bother about restarting, disk formats..bla..bla..bla.

I checked the new OS installation on my laptop. Well, I am impressed, everything seemed to be working smoothly.

My next step was to run the JikesRVM on eclipse to start some development.
in order to achieve this:

if you run
$ dpkg --get-selections | egrep '32|gcc'

u will get a list of the libraries you have on your system.
While for the jikes compilation u will need gcc multilib and g++ multilib
so, you should get the g++-multilib by running
$ sudo apt-get install g++-multilib
You will also need Bison
$ sudo apt-get install bison
get ant
$ sudo apt-get install ant
get your Java packages by running..
$ sudo apt-get update
$ sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin

In case you have other java installations ..Run this command to fix configurations.
$ sudo update-java-alternatives -s java-6-sun
Set your $JAVA_HOME variable
$ sudo gedit /etc/environment
and add JAVA_HOME = "/usr/lib/jvm/java-sun-6"

Re-login
Download eclipse from its official site.
$ sudo apt-get install subversion
$ svn co https://jikesrvm.svn.sf.net/svnroot/jikesrvm/rvmroot/trunk jikesrvm
$ cd jikesrvm
jikesrvm$ bin/buildit --eclipse localhost -j $JAVA_HOME
Import the project into workspace.

I found some errors in the source code after getting the project into eclipse.
My friend Morshedy advised that it may be a common problem with the eclipse, so I run the
jikesrvm$ find -wholename *.java  -exec touch {} \;
but didn't solve it.

So, I guess I will wait for an update on the SVN.

Update: it was not my lucky day when I was building jikes..I tried to build it many times on that day. but I got errors when openening in eclipse...
So, I retired again a day later by :
jikesrvm$ rm rf components
jikesrvm$ ant very-clean
and then rebuild..it worked fine this time