Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

test runs on windows, program hangs on linux

 
rinke hoekstra
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I already scheduled my essay exam, I finished the work on the code, but now I tested the program on another OS, and guess what, it hangs!!

I developed and tested on windows 2000, which worked perfect.

When testing on red hat linux however, the program hangs in the clean closing of the database (using a shutdownhook) and the server won't even start!!

1) How is this possible? I thought java was "code once, run everywhere"?

2) Will this cause me grading problems?


rinke
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's an interesting question and I do want to know the cause for it .

I would say the compiled Java code can be run everywhere without having any impact on the output while running it on other OS, which is what guaranteed! But hanging is a different issue as there may be some other environmental/OS related factors contributing for it.

I am not very sure but a wild guess!
[ June 25, 2008: Message edited by: Raghavan Muthu ]
 
rinke hoekstra
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Raghavan Muthu:
But hanging is a different issue as there may be some other environmental/OS related factors contributing for it.


Yes, I guess you are right. It must be something environmental.

But the problem scares me quite a bit.
 
Jeffry Kristianto Yanuar
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe that's because Windows and Linux have different Threading mechanism.
 
Jason Moors
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Jeffry, sounds like you've got a thread deadlock due to the different thread mechanisms. Windows performs time slicing where as linux will execute each thread to completion unless it leaves the running state.

Are you peforming yield in your code?

I'd suggest you check the order the threads are processed.

Jason
[ June 26, 2008: Message edited by: Jason Moors ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic