Tell Me What Is Thread
What Is Thread
Collapse
X
-
Tags: None
-
Originally posted by Pallavi KadamTell Me What Is Thread
Unlike many other computer languages, Java provides built-in support for multithreaded programming. A multithreaded program contains two or more parts that can run concurrently.Ea ch part of such a program is called a thread, each thread defines a seperate path of execution.
Multithreading enables you to write very efficient programs that make maximum use of the CPU, because idle time can be kept to a minimum.This is especially important for the interactive, networked environment in which Java operates, because idle time is common and by using threads it can be minimized!
This was a very general description, you must go through a tutorial on threads to get a good idea!Comment
-
Thread is as similar as for other languages,
It works simuntaneously different work at once without spending more time.Comment
-
A thread is a thread of execution in a program. The Java Virtual Machine allows an application to have multiple threads of execution running concurrently.
Every thread has a priority. Threads with higher priority are executed in preference to threads with lower priority. Each thread may or may not also be marked as a daemon. When code running in some thread creates a new Thread object, the new thread has its priority initially set equal to the priority of the creating thread, and is a daemon thread if and only if the creating thread is a daemon.
When a Java Virtual Machine starts up, there is usually a single non-daemon thread (which typically calls the method named main of some designated class). The Java Virtual Machine continues to execute threads until either of the following occurs:
•The exit method of class Runtime has been called and the security manager has permitted the exit operation to take place.
•All threads that are not daemon threads have died, either by returning from the call to the run method or by throwing an exception that propagates beyond the run method.Comment
-
Multithreading refers to two or more tasks executing concurrently within a single program. A thread is an independent path of execution within a program. Many threads can run concurrently within a program. Every thread in Java is created and controlled by the java.lang.Threa d class. A Java program can have many threads, and these threads can run concurrently, either asynchronously or synchronously.Comment
-
A thread is actually a lightweight process. Unlike many other computer languages, Java provides built-in support for multithreaded programming. A multithreaded program contains two or more parts that can run concurrently. Each part of such a program is called thread and each thread defines a separate path of execution. Thus, multithreading is a specialized form of multitasking.It is a separate path of execution.Comment
-
A Thread is a very light-weighted process, which allows a program to operate more efficiently by running multiple tasks simultaneously.
Thread in Java are used to perform complicated tasks. All the tasks are executed without affecting the main program. In a program or process, all the threads have their own separate path for execution, so each thread of a process is independent.Comment
Comment