Difference Between Process and Thread in OS

Advertisements

Kernel vs Operating System Paging and Segmentation in Operating System

Difference Between Process and Thread in Operating System

A thread is a path of execution within a process. A process can contain multiple threads.

Process: A process is basically a program in execution. The execution of a process must progress in a sequential fashion. In computing, a process is the instance of a computer program that is being executed by one or many threads. It contains the program code and its activity. Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently.

Thread: Thread is an execution unit that consists of its own program counter, a stack, and a set of registers where the program counter mainly keeps track of which instruction to execute next, a set of registers mainly hold its current working variables, and a stack mainly contains the history of execution.

Difference Between Process and Thread in Operating System

ParameteProcessThread
DefinitionProcess means a program is in execution.Thread means a segment of a process.
LightweightThe process is not Lightweight.Threads are Lightweight.
Termination timeThe process takes more time to terminate.The thread takes less time to terminate.
Creation timeIt takes more time for creation.It takes less time for creation.
CommunicationCommunication between processes needs more time compared to thread.Communication between threads requires less time compared to processes.
Context switching timeIt takes more time for context switching.It takes less time for context switching.
ResourceProcess consume more resources.Thread consume fewer resources.
Treatment by OSDifferent process are tread separately by OS.All the level peer threads are treated as a single task by OS.
MemoryThe process is mostly isolated.Threads share memory.
SharingIt does not share dataThreads share data with each other.

Kernel vs Operating System Paging and Segmentation in Operating System

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements