wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Threads

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

Beauty of indian railway

Blog banner

MOVEMBER

Blog banner

AI and Data Science: Revolutionizing Industries

Blog banner

MODERN OPERATING SYSTEM

Blog banner

VIRTUAL MACHINE

Blog banner

Service Validation and Testing during the Design Phase

Blog banner

Expert System In AI

Blog banner

Critical success factors

Blog banner

Biometric Authentication and Privacy: Balancing Ethical Concerns

Blog banner

Beyond the Track: Why the Best Hotel in Arcadia, Florida, Completes Your IMSA Sebring Getaway

Blog banner

Global versus Indian Mental Health Differences

Blog banner

Memory Management in Operating System

Blog banner

Introduction to Solidity Programming for Blockchain Development

Blog banner

Music

Blog banner

Life of an army person

Blog banner

Modern operating system

Blog banner

Security issues in Sensor Networks and gathering admissible evidence in Network Forensics

Blog banner

?Why Social and Emotional Skills Matter More Than ABCs in Early Years?

Blog banner

Real-time Scheduling - 53003230061

Blog banner

Secure Hypertext transfer protocol

Blog banner

CRISP-DM Methodology

Blog banner

File and File System Structure

Blog banner

A Statistical Analysis of Player Performance and their Value in cricket

Blog banner

PERSONAL STORIES

Blog banner

 " Healing of Yoga "

Blog banner

Modern Teaching Methods: Why Inquiry-based & Experiential Learning Works Best

Blog banner

MULTITHREADING:ENHANCEING PERFORMANCE AND EFFICIENCY IN COMPUTING

Blog banner

It's all about our Brain.- The Brain Metaphor

Blog banner

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

Blog banner

Socket Programming in Java

Blog banner

Operating system

Blog banner

What is Segmentation?

Blog banner

Memory Management in Operating System

Blog banner

Utilizing Data-Hiding and Retrieval Techniques in Cyber Forensics

Blog banner

Types of E-Commerce

Blog banner

Service transistion under difficult conditions

Blog banner

Process states

Blog banner

What if COVID does not exist!

Blog banner

M commerce

Blog banner

Chicken Dum Biryani

Blog banner

Explain the concept of ( MIS) Management information systems

Blog banner

The New Dr. Frankenstein who will perform first full head transplant

Blog banner