wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Threading

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

Modern operating system

Blog banner

HUBSPOT

Blog banner

Education: Key to your Prosperity

Blog banner

Blog name

Blog banner

Expert System In AI

Blog banner

Memory hierarchy

Blog banner

Direct memory access (DMA)

Blog banner

Compromising Mobile Platforms

Blog banner

A Review on Data Acquisition in Cyber Forensics

Blog banner

The Impact of Tolerances and Wall Thickness on Pipeline Integrity

Blog banner

MUTUAL EXCLUSION

Blog banner

Modern Operating Systems

Blog banner

10 Things To Do On Valentine's Day If You're Single

Blog banner

Sleep Matters: The Science Behind Toddler Naps

Blog banner

Memory managment

Blog banner

A Day in the Life at Elzee: What Your Child Does Between Drop-Off and Pick-Up

Blog banner

Healthy Indian Dinner Ideas for Better Digestion and Sleep

Blog banner

Mumbai famous street food

Blog banner

Twisted world

Blog banner

Spyware

Blog banner

Healthy Indian Comfort Foods That Are Both Nutritious and Delicious

Blog banner

Session Vulnerabilities

Blog banner

Lemon and Chilli Pickle (Limbu Mirchi Achar)

Blog banner

Overcoming the bedtime brushing Battle with Dr. Roxanne Irani, Dentist in Maroubra

Blog banner

A Journey By Train

Blog banner

Benefits of yoga and meditation

Blog banner

Things You Should Leave Behind In 2025, Whilst In 2026

Blog banner

IoT Architecture Based Security

Blog banner

Sarasota Polo Club, Myakka City — A Luxury Day Trip from Oak Tree Hotel, Arcadia

Blog banner

Pioneer Park Zolfo Springs — A Hidden Gem for Nature Lovers Near Arcadia

Blog banner

Sniffing: A Cyber Security Threat

Blog banner

Game Theory in Blockchain

Blog banner

Starting Android Activity Using Intent

Blog banner

Deadlock

Blog banner

The Role of Data Provenance and Lineage in Modern Data Science

Blog banner

From Model Mistakes to Metrics

Blog banner

Health and fitness in technology

Blog banner

TOGETHER WE CAN CONQUER #team

Blog banner

Memory Management

Blog banner

Platonic Solids

Blog banner

Protect yourself from System Hacking with these Simple Steps

Blog banner

Healthy Habits Children Learn at Preschool That Last a Lifetime

Blog banner