wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Threading

profile
Sanket Deora
Jul 15, 2023
0 Likes
0 Discussions
148 Reads

Thread is a single sequence stream within a process. Threads have same properties as of the process so they are called as light weight processes. Threads are executed one after another but gives the illusion as if they are executing in parallel. Each thread has different states. 

Similarity between Threads and Processes –  

 

Only one thread or process is active at a time 

Within process both execute sequential

Both can create children 

Both can be scheduled by the operating system: Both threads and processes can be scheduled by the operating system to execute on the CPU. The operating system is responsible for assigning CPU time to the threads and processes based on various scheduling algorithms.

Both have their own execution context: Each thread and process has its own execution context, which includes its own register set, program counter, and stack. This allows each thread or process to execute independently and make progress without interfering with other threads or processes.

Both can communicate with each other: Threads and processes can communicate with each other using various inter-process communication (IPC) mechanisms such as shared memory, message queues, and pipes. This allows threads and processes to share data and coordinate their activities.

Differences between Threads and Processes –  

 

Resources: Processes have their own address space and resources, such as memory and file handles, whereas threads share memory and resources with the program that created them.

Scheduling: Processes are scheduled to use the processor by the operating system, whereas threads are scheduled to use the processor by the operating system or the program itself.

Creation: The operating system creates and manages processes, whereas the program or the operating system creates and manages threads.

Communication: Because processes are isolated from one another and must rely on inter-process communication mechanisms, they generally have more difficulty communicating with one another than threads do. Threads, on the other hand, can interact with other threads within the same programme directly.


Comments ()


Sign in

Read Next

How I use google in my daily life

Blog banner

Evolution of operating systems

Blog banner

Deadlock Prevention

Blog banner

File Allocation Methods

Blog banner

Memory management

Blog banner

Kernel Modes: User Mode vs. Kernel Mode - 80

Blog banner

Dr. Venkadavarahan

Blog banner

10 Amazing facts about Tokyo Ghoul

Blog banner

Theads

Blog banner

What is OS Fingerprinting?

Blog banner

VPN

Blog banner

Explain website hacking issues

Blog banner

"The Benefits of Using GIS in Agriculture"

Blog banner

A Happier Workplace Starts with Healthy Lunches by Meal Maharaj

Blog banner

Internet of Things and cyber security

Blog banner

The Importance of Financial Literacy for College Students

Blog banner

Cyber Bullying - Neeta Vonkamuti

Blog banner

Fault tolerance

Blog banner

Data Mining

Blog banner

Deadlock and Starvation

Blog banner

The Psychology of Diversity, Equity & Inclusion: How Inclusive Workplaces Boost Productivity

Blog banner

Memory managment

Blog banner

Starting Android Activity Using Intent

Blog banner

File management

Blog banner

Process in OS

Blog banner

Deadlock and starvation in operating system

Blog banner

Travel Geek ‘The last $50k in Switzerland’

Blog banner

Teenagers of Today

Blog banner

GIS in Disaster Management

Blog banner

Data Science in Mental Health Prediction

Blog banner

Modern Operating Systems.

Blog banner

The Art of Slow Fashion: Why Patola Defines Sustainable Luxury

Blog banner

Virtualization

Blog banner

Sensory Play for Toddlers: Boosting Curiosity Through Touch, Sound, and Colour

Blog banner

Memory Management of Operating System(OS)

Blog banner

Cache Memory

Blog banner

Introduction to Solidity Programming for Blockchain Development

Blog banner

Product Discount Calculator

Blog banner

Drawing tips for a beginner

Blog banner

Palm Vein Biometric Technology; Contactless vein authentication

Blog banner

Multicore CPUs

Blog banner

Multiple-Processor Scheduling in Operating System

Blog banner