Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Programming Threads > Why programs im...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 23 Topic 4075 of 4146
Post > Topic >>

Why programs implemented with Java threads sometimes run extremely

by climber.cui@[EMAIL PROTECTED] Oct 9, 2008 at 09:02 AM

Hi All,
  I am comparing the performance of the Dining philosopher's problem
implemented in Java, Ada, C/Pthread, and the experimental language I
have been working on.
  The algorithm is very simple: let a butler to restrict entry to the
eating table, so that deadlock is prevented.
   The comparison result really surprised me, and raised a big
question mark : why java runs so fast?
 The programs were constructed with basic API's and functions. I tried
to stay away from pre-defined synchronization features such as
Semaphores , atomic variables, etc.

 I let each philosopher to eat 10000 times ->
   Java :3.6 second, C/pthread : 7.0 seconds, Ada :8.3 seconds..

 I measured the execution time by a simple ./time command on Linux. It
is coarse-grained measurement, but probably adequate to make
comparisons.

 I would expect the java program to be the slowest one. However, java
is the winner. If I let each philosopher to eat 20000 rounds, Java
would have bigger advantage over C and Ada.

 Does anyone here have some notions about the Java thread
implementations that can explain the cause?  or Does anyone know where
I can possibly find the answer?

thanks a lot.

cheers,

Tony
 




 23 Posts in Topic:
Why programs implemented with Java threads sometimes run extreme
climber.cui@[EMAIL PROTEC  2008-10-09 09:02:15 
Re: Why programs implemented with Java threads sometimes run
Michael Mol <mikemol@  2008-10-09 10:11:13 
Re: Why programs implemented with Java threads sometimes run
climber.cui@[EMAIL PROTEC  2008-10-09 12:47:52 
Re: Why programs implemented with Java threads sometimes run
David Schwartz <davids  2008-10-09 14:48:00 
Re: Why programs implemented with Java threads sometimes run ext
"Chris M. Thomasson&  2008-10-09 21:15:01 
Re: Why programs implemented with Java threads sometimes run ext
"Chris M. Thomasson&  2008-10-09 21:24:38 
Re: Why programs implemented with Java threads sometimes run
climber.cui@[EMAIL PROTEC  2008-10-10 09:06:59 
Re: Why programs implemented with Java threads sometimes run
climber.cui@[EMAIL PROTEC  2008-10-10 09:10:33 
Re: Why programs implemented with Java threads sometimes run
Szabolcs Ferenczi <sza  2008-10-10 10:51:30 
Re: Why programs implemented with Java threads sometimes run ext
"Chris M. Thomasson&  2008-10-10 12:04:44 
Re: Why programs implemented with Java threads sometimes run ext
"Chris M. Thomasson&  2008-10-10 13:20:49 
Re: Why programs implemented with Java threads sometimes run
Szabolcs Ferenczi <sza  2008-10-10 12:32:57 
Re: Why programs implemented with Java threads sometimes run
Szabolcs Ferenczi <sza  2008-10-10 13:42:32 
Re: Why programs implemented with Java threads sometimes run ext
"Chris M. Thomasson&  2008-10-10 14:09:14 
Re: Why programs implemented with Java threads sometimes run ext
"Chris M. Thomasson&  2008-10-10 14:12:32 
Re: Why programs implemented with Java threads sometimes run
Szabolcs Ferenczi <sza  2008-10-10 14:04:43 
Re: Why programs implemented with Java threads sometimes run ext
"Chris M. Thomasson&  2008-10-10 14:17:26 
Re: Why programs implemented with Java threads sometimes run ext
"Chris M. Thomasson&  2008-10-11 22:14:10 
Re: Why programs implemented with Java threads sometimes run
Szabolcs Ferenczi <sza  2008-10-10 14:22:22 
Re: Why programs implemented with Java threads sometimes run ext
"Chris M. Thomasson&  2008-10-10 14:35:31 
Re: Why programs implemented with Java threads sometimes run ext
"Chris M. Thomasson&  2008-10-10 16:23:18 
Re: Why programs implemented with Java threads sometimes run ext
"Chris M. Thomasson&  2008-10-11 22:12:40 
Re: Why programs implemented with Java threads sometimes run
David Schwartz <davids  2008-10-10 19:40:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 8:50:51 CST 2008.