Skip to end of banner
Go to start of banner

invocation sequence thread identification

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Goals

  • Uniquely identify a Thread within one JVM

Thread/Runnable

  • Each thread provides a thread id that is unique within one JVM
  • Threads can only be started once (a second start will result in an exception)
  • Thread pools
    • Application server usually make use of thread pools, that is they re-use threads and just provide new Runnable instances to thread
    • Thus the thread ID is not uniquely identifying a job that is executed by a thread, but one thread ID will in fact run multiple jobs
    • The new Executor classes in Java6 provide an implementation of a thread pool
  • Runnables
    • Are used to execute jobs (in fact each Thread defines its functionality as Runnable)
    • Runnables can be reused
  • No labels