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

About threads

 
phani bhushan reddy
Greenhorn
Posts: 27
Eclipse IDE Fedora Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody tell me how to trace the behaviour of Threads, I know the basics of Threads, but i am unable to trace out the output, if the program is too large
please help me, thanks in advance
 
srinivas sridaragaddi
Ranch Hand
Posts: 225
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you just put up some code or snippet and explain your doubt.May be i can try.
 
subodh gupta
Ranch Hand
Posts: 203
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
their are certain things which decide the threads running pattern like their priority, sleep, object lock are some to mention.

But their are lot things which depends upon the JVM and OS.

So to know exact behavior is impossible because same program may behave differently on different machines.
 
srinivas sridaragaddi
Ranch Hand
Posts: 225
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok if you are using yield() method in your code and you have more than one thread of same priority running.Then after teh Yield() method is called it depends on JVM which will select one out off the pool of threads of same priority.

I hope this would bring some light on codes which contain more than one Thread of same priority running....
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic