wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Threads

profile
AARON Dsouza
Jul 04, 2024
0 Likes
0 Discussions
51 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

SmartData Collective: Data Science aur Analytics ki Duniya

Blog banner

Kernel in Operating System

Blog banner

Understanding Gen Z: A Generation Facing Crisis and Potential

Blog banner

COMFORT IS ALL ABOUT FASHION

Blog banner

Blockchain

Blog banner

Why Time Management Is the Secret to College Success (and How to Master It)

Blog banner

Memory Management

Blog banner

Music

Blog banner

Hosting basics

Blog banner

Virtual Machine's

Blog banner

WHAT IS SNAPCHAT AND HOW DOES IT WORK?

Blog banner

1.1 basic elements

Blog banner

Evolution of Operating system

Blog banner

EID UL FITR

Blog banner

15 Interesting Facts about India

Blog banner

The role of artificial intelligence in automating digital forensic analysis.

Blog banner

Concurrency management in operating systems

Blog banner

Discover The Top 3 Places To Stay in London

Blog banner

DURGA POOJA

Blog banner

MQTT (MQ Telemetry Transport) in Data Science

Blog banner

Decoding the Weave — How to Identify Original Patola Art on a Fabric

Blog banner

Delhi city

Blog banner

Palm Vein Biometric Technology; Contactless vein authentication

Blog banner

Apache Kafka

Blog banner

OS PROCESS DESCRIPTION AND CONTROL-SARVAGYA JALAN

Blog banner

Vulnerability Assessment

Blog banner

Types of Hackers.

Blog banner

Introduction to Solidity Programming for Blockchain Development

Blog banner

Mumbai Metro 3

Blog banner

Goa Trip With Friends

Blog banner

Cloud Computing: Threats and Vulnerabilities

Blog banner

Process, process creation and process termination

Blog banner

RAID

Blog banner

Top 5 Tech Innovations of 2018

Blog banner

What is time ? The term which has astonished Scientists

Blog banner

Landslide Hazard

Blog banner

Data Science in Healthcare: Predicting Diseases

Blog banner

Data Visualization- Importance and tools (Tableau,Power BI, Matplotlib)

Blog banner

"Audit" In Data Science

Blog banner

The Art Of Getting What You Want In Life....

Blog banner

IT RISK

Blog banner

Digital marketing spotlight “Dove’s Real Beauty Campaign”

Blog banner