Java.Lang.Thread Class
Each Thread has an integer priority that basically determines the amount of CPU time the Thread gets.

See Also: Thread Members

Syntax

[Android.Runtime.Register("java/lang/Thread", DoNotGenerateAcw=true)]
public class Thread : Object, IRunnable

Remarks

A Thread is a concurrent unit of execution. It has its own call stack for methods being invoked, their arguments and local variables. Each virtual machine instance has at least one main Thread running when it is started; typically, there are several others for housekeeping. The application might decide to launch additional Threads for specific purposes.

Threads in the same VM interact and synchronize by the use of shared objects and monitors associated with these objects. Synchronized methods and part of the API in Java.Lang.Object also allow Threads to cooperate.

There are basically two main ways of having a Thread execute application code. One is providing a new class that extends Thread and overriding its Thread.Run method. The other is providing a new Thread instance with a Java.Lang.IRunnable object during its creation. In both cases, the Thread.Start method must be called to actually execute the new Thread.

Each Thread has an integer priority that basically determines the amount of CPU time the Thread gets. It can be set using the Thread.set_Priority(int) method. A Thread can also be made a daemon, which makes it run in the background. The latter also affects VM termination behavior: the VM does not terminate automatically as long as there are non-daemon threads running.

See Also

[Android Documentation]

Requirements

Namespace: Java.Lang
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: API Level 1