Difference Between Threads and Process
Difference Between Threads and Process
THREADS PROCESS
Thread means a segment of a process. Process means a program is in
execution.
Threads are usually take less
Takes more time to terminate.
time to terminate.
They are not lightweight.
They are lightweight.
Takes more time for creation.
It take less time for creation. THREADS
Communication between processes
Communication between threads needs more time compared to thread.
requires less time compared to process. VS. It takes more time for context
It takes less time for context switching. switching.
A thread is a basic unit of CPU utilization. It comprises a thread ID, a program counter, a
register set, and a stack. It shares with other threads belonging to the same process its
code section, data section, and other operating system resources, such as open files
and signals. In short, with many threads, your CPU can handle several tasks at the
same time making the tasks faster. For instance, because of threads only you are able
to browse the web as well as listen to music simultaneously. So if you want to run
multiple processes that are very intensive, you may need a CPU with plentyof threads.