wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Threads

profile
AARON Dsouza
Jul 04, 2024
0 Likes
0 Discussions
52 Reads

A thread is the smallest unit of the code execution in a process

A program may have multiple processes and a process may have multiple threads execution processes occur in the cpu. A thread is a basic utilization of cpu

A thread consists of

• Thread id

• A program counter

• Register set

• Stack

It also shares code section, data section and other operating system resource with the same process, a process is heavy weight if it performs a single thread but multiple threads will allow multiple task execution

Benefits of multithreading

• Responsiveness: eg in a Gui one thread handles frontend Ui and another handles backend process

• Improved performance: significant boost in application as multiple threads run parallelly decreasing the time

• Resource sharing: threads of the same process also share code section, data section and other operating system resource with the same process, making the communication between them easy

• Scalability: multithreads handle increasing workloads significantly by dividing tasks among each other

Multi-threading

Types of threads

• User thread: used by developers and are supported above the kernel and managed without kernel support

• Kernel thread: supported and managed directly by operating system

For a system to exits there should be relationship between user and kernel threads

Types of relationships:

1. One to one

2. Many to one

3. Many to many

One to one: 1 user thread maps to 1 kernel thread, provides more concurrency than many to 1 as it allows a new thread to run when a thread makes blocking call, allows multiple threads to run inn parallel on multiprocessors. But creating a user thread forces to create a kernel thread and overhead of creating kernel thread can cause burden in the application

Many to one: many user threads access 1 kernel thread and the thread management is done by thread library in user space and makes it efficient. But if one of the many user threads makes a blocking system call then the kernel thread will be blocked and entire process will be blocked. Because one thread accesses 1 kernel at a time multiple threads don’t run in parallel on multiprocessors because 1 kernel only runs 1 process.

Many to many: Many user threads are mapped to many kernel threads and number of kernel threads may be specific to an application or machine, developers can create multiple user threads and they run in parallel in a multiprocessor and when a user thread asks for a blocking system call the kernel can execute another thread for execution

DONE BY AARON DSOUZA

53003230005

 

 

 

 

 

 

 

 

 


Comments ()


Sign in

Read Next

Some web vulnerabilities

Blog banner

CYBERPEACEKEEPING: NEW WAYS TO PREVENT AND MANAGE CYBERATTACKS

Blog banner

Decoding Confusion Matrix

Blog banner

10 Signs your Computer has Virus

Blog banner

Solitary Play Activities for Preschoolers: Types and Benefits

Blog banner

PROCESS STATE:

Blog banner

Ransomware

Blog banner

Odoo

Blog banner

What is OS and its overview

Blog banner

Virtual Memory

Blog banner

Virtual memory

Blog banner

ARTICAL ON MANAGEMENT SYSTEM

Blog banner

Memory Management

Blog banner

First-Order Logic (FOL): The Foundation of Modern Logic

Blog banner

Types of Threads

Blog banner

10 Amazing facts about Tokyo Ghoul

Blog banner

Dekkers Algorithm : Ensuring Safe Process Synchronization

Blog banner

Assignment-3

Blog banner

Cyber-crime Investigation and Future Directions

Blog banner

BUSINESS MODELS OF E COMMERCE

Blog banner

Who decides your overthinking, anyway?

Blog banner

What is Anxiety? How to manage Anxiety?

Blog banner

City of Mumbai (Bombay):

Blog banner

What is Influencer Marketing and its Trends

Blog banner

Tableau

Blog banner

CyberSecurity Color Wheel

Blog banner

Understanding Regression Analysis

Blog banner

File system implementation

Blog banner

Linux 94

Blog banner

VIRUS

Blog banner

Rapido

Blog banner

Compromising Mobile Platforms

Blog banner

ADD A SPICE TO YOUR LIFE.

Blog banner

Best Time to Visit Arcadia, Florida & Why Oak Tree Hotel Is Always Ready

Blog banner

Fashion design

Blog banner

Challenges and risks in service operations

Blog banner

Objectives and functions of Operating System...

Blog banner

?What Children Learn Between Activities: The Hidden Learning Moments in a Preschool Day

Blog banner

How Much Protein Do You Really Need Every Day?

Blog banner

6 Digital Marketing Trends You Must Watch Out For In 2022

Blog banner

Should you be using a mouthwash? Know from the experts

Blog banner

Gis in agriculture and farming

Blog banner