wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Threading

profile
Sanket Deora
Jul 15, 2023
0 Likes
0 Discussions
152 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

Mumbai local ......

Blog banner

Virtual Memory

Blog banner

E-learning

Blog banner

Paginng In OS

Blog banner

The Memory Hierarchy

Blog banner

10 Interesting Facts about Attack on Titan

Blog banner

Information of meesho company

Blog banner

Article on Team Work

Blog banner

Process, process creation and process termination

Blog banner

Mumbai Metro 3

Blog banner

Denial-of-Service and Distributed Denial-of-Service Attack Techniques

Blog banner

Exploring Arcadia’s Cowboy Culture, Peace River & Hidden Attractions

Blog banner

Wedding photographer

Blog banner

Tracking Emails & Email Crimes

Blog banner

Data Science in Healthcare: Predicting Diseases

Blog banner

Southern Turkey Earthquake: Causes and Consequences of a Tragic Natural Disaster

Blog banner

Theads

Blog banner

Types of Threads

Blog banner

Simple STEM Activities for Toddlers That Spark Curiosity

Blog banner

Have You Explored India Yet?

Blog banner

Travel: Everything Everywhere!

Blog banner

Multithreading in Operating System

Blog banner

Women empowerment

Blog banner

Predicting Student Performance with Data Science

Blog banner

Healthy Indian Dinner Ideas for Better Digestion and Sleep

Blog banner

Predictive Analytics: How Data Science Predicts Trends(Weather ,Stock Market,Sales Forecasting ).

Blog banner

Race Condition in Operating Theatre

Blog banner

Firewall in Computer Network

Blog banner

Threads

Blog banner

ACHIEVEMENTS IN OPERATING SYSTEMS

Blog banner

Incorporating Automation into Digital Forensics.

Blog banner

The Truth Behind Viral DIY Dental Hacks

Blog banner

Why Businesses Are Investing More in Automation than Advertising?

Blog banner

What Your Music Taste Reveals About Your Personality

Blog banner

INDIAN CHEAPEST COSMETICS BRAND

Blog banner

How can parents support a child’s mental health?

Blog banner

INTERNET SECURITY

Blog banner

How to use open SSL for web server - browser communication

Blog banner

Linux Virtual Machine Process Scheduling

Blog banner

Heart Fulness Meditation

Blog banner

Race Condition in Operating Theatre

Blog banner

Social Media.

Blog banner