oncept of thread in java:
-------------------------
Consider the computer game, The person is moving
from left to right. At the same
time diamond shapes are blinking at the bottom.
Java Threading Example
Thread is used for dividing the task of an
application into separate sub-processes
which can run simultaneously.
Suppose we need to execute the program, then that
program can be sub diveded into the number of small
sub processes. Each small sub process is called
as thread.
Introduction to Java Threads :
--A thread is a basic processing unit to which
OS can allocate processor time.
--A thread is lightweight process.
--A program can have multiple threads.
--A thread consumes some resources so we should
not use more thread than our requirement.
--A Java threads shares the common memory area
so memory allocation for each thread is not
required. So context switching requires less time than
using the multi-processing.
--Every Java program has at least one thread i.e the thread that
executes the Java Program
--Threads are faster and more efficient program
which increases speed of execution
--Only one thread is executed at a time.
threading