• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

test runs on windows, program hangs on linux

 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe that's because Windows and Linux have different Threading mechanism.
 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic