File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes About threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "About threads" Watch "About threads" New topic

About threads

phani bhushan reddy

Joined: Jul 20, 2007
Posts: 27

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

Joined: Jul 24, 2007
Posts: 225
Can you just put up some code or snippet and explain your doubt.May be i can try.

SCJP 5.0<br /> <br />"Skills are started with learning and mastered with improvement. Nothing is hereditary except death" BUDDHA...
subodh gupta
Ranch Hand

Joined: Jul 23, 2007
Posts: 203
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

Joined: Jul 24, 2007
Posts: 225
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....
I agree. Here's the link:
subject: About threads
It's not a secret anymore!