Thread Primer

 

 

 

Foreword

Resources

Code Listings

Foil Sets

Assignments

Solutions

External Resources

SiteMap

Search

Home

 

 

Up ] Introductory Examples ] Object Cloning ] Static Method's ] Sleep and Locks ] [ Thread Primer ] Daemon Threads ] Thread Synchronization ] Gaurded Suspension ] Deadlock ] Virtual Machine Threads ] Volitility ] Wait-Notify ]

 

 

Threads are a mechanism for introducing concurrency into programming languages. Java is remarkable for threads being built into the language Threads are "light-weight" processes (unlike UNIX processes), which communicate by a combination of shared memory and message passing. This communication mechanism is employed naturally by Java. Java threads are based on a locking mechanism using monitors for synchronization, introduced by Hoare in 1974. The interesting point to be noted is the fact that even if a Java application or an applet doesn’t create threads, the Java virtual machine starts up several threads to support the execution of the application or applet. Please refer to section 2.3.2 in the Java chapter for more information on threads.

Source

Test.java

JAR Files: Please refer to the Java-Basics section for more information on using JAR files.

Test.jar