File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

definition of thread?

 
sura watthana
Ranch Hand
Posts: 77
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anyone tell me what this statement is really saying about thread?


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

Thanks

 
Tom Tolman
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic