wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Threading

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

Why Festivals Are the Best Classrooms for Young Minds?

Blog banner

AI and Cyber Security

Blog banner

Blockchain Security Technique

Blog banner

Chicken Dum Biryani

Blog banner

Why Friendship at Work is Important

Blog banner

Why You Need 2FA (Two-Factor Authentication) On Your Email And Other Online Accounts

Blog banner

Stephen Hawking : A Remarkable Physicist

Blog banner

10 Interesting Facts about Death Note

Blog banner

How to Prepare Your Child for Their First Day of School?

Blog banner

Risk management in IT

Blog banner

Retiring ISS

Blog banner

Biometric Authentication and Privacy: Balancing Ethical Concerns

Blog banner

Discover The Top 3 Places To Stay in London

Blog banner

Bitcoin sent using radio waves! No internet!

Blog banner

Session Hijacking Techniques

Blog banner

Cloud Security: Trends and Innovations

Blog banner

The Everyday Parenting Dilemma: Safety Vs Independence

Blog banner

Operating System

Blog banner

Therapy Myths That Need to End in 2025

Blog banner

INTERNET

Blog banner

Explaining Buffer Overflow with Example

Blog banner

Domain Name System

Blog banner

DATA WRANGLING

Blog banner

evolution of operating system - Disha Parekh

Blog banner

Memory Management

Blog banner

Threads in OS

Blog banner

Krishna Rao SAP ID--53003230076

Blog banner

How return on investment is defined in IT services

Blog banner

Data Warehouse Bus Matrix

Blog banner

Evolution of Operating System

Blog banner

Safeguarding Your Data: The Importance of Wireless Encryption

Blog banner

Number Guessing game --lisp

Blog banner

15 Interesting Facts about India

Blog banner

Types of email

Blog banner

Multiple processor scheduling

Blog banner

Are Social Media Paid Campaigns Worth It?

Blog banner

Asana

Blog banner

Introduction to GIS

Blog banner

Skills An Ethical Hacker Must Have

Blog banner

Wedding photographer

Blog banner

Hot Mango Pickle (Methiyu)

Blog banner

What is metaverse?

Blog banner