Java thread jargon

In Java thread topic, the task to be executed and the thread to drive the task are two concepts should be clarified. The working process is like the following:

  1. Create one task
  2. Create one thread to be attached on your created task.

 

In Java, thread is not the task itself. The Runnable interface is used to describe the real task. Also, the name of Runnable is a bad choice for describing its job.

 

So, let's summarize these concepts with Java code:

[Concepts: Java Implementation]

  • task: described by Java interface Runnable.
  • mechanism to drive task: Java's Thread class.

 

posted @ 2015-06-12 10:58  kid551  阅读(153)  评论(0编辑  收藏  举报