ASSIGNMENT THREADS URK19CS1037
1. List the differences between process and threads.
2.
a. Java Thread
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.
The Java run-time system depends on threads for many things. Threads reduce
inefficiency by preventing the waste of CPU cycles.
b. Windows thread
A thread is the basic unit to which the operating system allocates processor
time. A thread can execute any part of the process code, including parts
currently being executed by another thread. A job object allows groups of
processes to be managed as a unit.
Parameter Process Thread
Process means a program is in Thread means a segment of a
Definition
execution. process.
Lightweight The process is not Lightweight. Threads are Lightweight.
Termination The process takes more time to The thread takes less time to
time terminate. terminate.
Creation time It takes more time for creation. It takes less time for creation.
Communication between Communication between threads
Communication processes needs more time requires less time compared to
compared to thread. processes.