File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can this be a case of deadlock ?And how to determine it output ?

 
A Agr
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Himalay Majumdar
Ranch Hand
Posts: 324
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it is ...try the following code



Getting a deadlock is very unlikely to happen so usually..you will get an output under normal condition. Here by putting sleep method in .I am making it more probable for a deadlock to happen. I many situations..even without a sleep() method..the thread scheduler can behave in such way..that creates deadlock situation.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic