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 definition of thread? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "definition of thread?" Watch "definition of thread?" New topic

definition of thread?

sura watthana
Ranch Hand

Joined: Sep 13, 2004
Posts: 77
Could anyone tell me what this statement is really saying about thread?

"A thread is an independent sequential path of execution within a program."


Tom Tolman
Ranch Hand

Joined: Sep 02, 2004
Posts: 83
One way to look at it is that normally your code has a linear flow to it- one line executes, and then the next line executes. It always goes in order. It may branch, but the branches are determined deterministically by comparisons.

Now when you add a thread, there are two independent threads of execution which interact. A single line of code can execute, then the thread can switch, and this same line of code can execute again!
I agree. Here's the link:
subject: definition of thread?
Similar Threads
What's is wrong with the world?
Indian arranged marriages
why thread priority is not working here
What does new Thread() mean?
Getting Data From Nested Threads.