SlideShare a Scribd company logo
THREADS
BY SALMAN MEMON
2K12/IT/109
UNIVERSITY OF SINDH
JAMSHORO
INTRODUCTION
A thread is contained inside a
process and different threads
in the same process share
some resources (most
commonly memory), while
different processes do not.
Process and threads
INTRODUCTION
A thread is a basic unit of CPU utilization, consisting of a
program counter, a stack, and a set of registers, ( and a
thread ID. )
On a single processor, multithreading generally
occurs by as in multitasking, the processor switches
between different threads.
On a multiprocessor or multi-core system, the threads
or tasks actually do run at the same time, with each
processor or core running a particular thread or task
SINGLE AND MULTI
THREAD
Single Thread
◦Has single thread of control
◦It allows the process to perform only 1 task at a time.
Multi thread
◦Has many threads
◦Simultaneous execution of different task
BENEFITS
Take less time to create a new tread than a process.
Less time to terminate a tread than a presses.
less time to switch between two treads within the same process.
Hence treads within the same process share memory and files,
they can communicate with each other without invoking the
kernel.
Responsiveness.
Resource sharing .
Economy.
Utilization of MP Architectures.
User Threads
Thread management done by user-level threads
library
◦Thread creation, scheduling, are done in user level
Fast to create and manage
Drawback:
◦If kernel is single thread, then user level thread performing a
blocking system call will cause entire process to block
KERNEL THREAD
Supported by OS
◦Thread creation, scheduling, are done in user level by kernel
Thread management is performed by os, thus kernel
thread are slow.
If thread perform blocking system call, kernel can
schedule another thread in application for execution
Multithreading Models
(In a specific implementation, the user threads must
be mapped to kernel threads, using one of the
following strategies. )
Many-to-One
One-to-One
Many-to-Many
MANY-TO-ONEmany user-level threads are all
mapped onto a single kernel thread.
Thread management is handled by
the thread library in user space,
which is very efficient.
if a blocking system call is made, then
the entire process blocks, even if the
other user threads would otherwise
be able to continue.
Ex: Green threads for Solaris and GNU
Portable
ONE-TO-ONE MODEL
Each user-level thread maps to kernel thread
Allow anther thread to run if block
Run parallel
Drawback: along with user thread kernel thread shld be
created.
Ex: Linux and Windows from 95 to XP
MANY-TO-MANY
The many-to-many model multiplexes
any number of user threads onto an
equal or smaller number of kernel
threads, combining the best features of
the one-to-one and many-to-one
models.
Blocking kernel system calls do not
block the entire process.
Individual processes may be allocated
variable numbers of kernel threads,
depending on the number of CPUs
present and other factors.
Ex: RIX, HP-UX, and Tru64 UNIX
Thread Libraries
Thread libraries provide programmers with an API for
creating and managing threads.
Thread libraries may be implemented either in user space
or in kernel space.
There are three main thread libraries in use today:
 POSIX Pthreads .
Win32 threads.
Java threads .
Pthreads
May be provided either as user-level or kernel-level.
A POSIX standard (IEEE 1003.1c) API for thread creation and
synchronization.
API specifies behavior of the thread library, implementation is up
to development of the library.
Common in UNIX operating systems (Solaris, Linux, Mac OS X).
Linux Threads
Linux refers to them as tasks rather than threads.
Thread creation is done through clone() system
call.
clone() allows a child task to share the address
space of the parent task (process).
Os Threads
Ad

More Related Content

What's hot (20)

Kernel. Operating System
Kernel. Operating SystemKernel. Operating System
Kernel. Operating System
pratikkadam78
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating Systems
Nitish Gulati
 
Demand paging
Demand pagingDemand paging
Demand paging
Trinity Dwarka
 
Threads .ppt
Threads .pptThreads .ppt
Threads .ppt
meet darji
 
Multithreading
MultithreadingMultithreading
Multithreading
Dr. A. B. Shinde
 
Multithreading
Multithreading Multithreading
Multithreading
WafaQKhan
 
Methods for handling deadlock
Methods for handling deadlockMethods for handling deadlock
Methods for handling deadlock
sangrampatil81
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
vampugani
 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
Shashank Kapoor
 
Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structures
Mukesh Chinta
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
International Center for Chemical & Biological Sciences
 
Kernels and its types
Kernels and its typesKernels and its types
Kernels and its types
ARAVIND18MCS1004
 
Processes and threads
Processes and threadsProcesses and threads
Processes and threads
Krasimir Berov (Красимир Беров)
 
Storage Management
Storage ManagementStorage Management
Storage Management
Dr. SURBHI SAROHA
 
Multiprocessor
MultiprocessorMultiprocessor
Multiprocessor
Kamal Acharya
 
CS6401 OPERATING SYSTEMS Unit 2
CS6401 OPERATING SYSTEMS Unit 2CS6401 OPERATING SYSTEMS Unit 2
CS6401 OPERATING SYSTEMS Unit 2
Kathirvel Ayyaswamy
 
Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O Systems
Wayne Jones Jnr
 
Mass Storage Structure
Mass Storage StructureMass Storage Structure
Mass Storage Structure
Vimalanathan D
 
Chapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsChapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage Systems
Wayne Jones Jnr
 
Deadlock Avoidance - OS
Deadlock Avoidance - OSDeadlock Avoidance - OS
Deadlock Avoidance - OS
MsAnita2
 

Viewers also liked (12)

Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
Sonali Chauhan
 
Process and Threads in Linux - PPT
Process and Threads in Linux - PPTProcess and Threads in Linux - PPT
Process and Threads in Linux - PPT
QUONTRASOLUTIONS
 
Ch5: Threads (Operating System)
Ch5: Threads (Operating System)Ch5: Threads (Operating System)
Ch5: Threads (Operating System)
Ahmar Hashmi
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
Dr. Loganathan R
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
International Islamic University
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
Deepika Balichwal
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
Prasunjeet Soni
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
Mohd Tousif
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
Abhishek Nagar
 
Interprocess Communication
Interprocess CommunicationInterprocess Communication
Interprocess Communication
Deepak H L
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
RJ Mehul Gadhiya
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
Anil Kumar Pugalia
 
Ad

Similar to Os Threads (20)

Treads
TreadsTreads
Treads
nayanashetty7
 
Wiki 2
Wiki 2Wiki 2
Wiki 2
Sid Hegde
 
W-9.pptx
W-9.pptxW-9.pptx
W-9.pptx
alianwarr
 
Concept of thread, multi thread, tcb
Concept of thread, multi thread, tcbConcept of thread, multi thread, tcb
Concept of thread, multi thread, tcb
Kanza batool
 
Networking threads
Networking threadsNetworking threads
Networking threads
Nilesh Pawar
 
Operating System-Thread concept in Operating System
Operating System-Thread concept in Operating SystemOperating System-Thread concept in Operating System
Operating System-Thread concept in Operating System
cscprabh
 
Multi threading models(operating systems)
Multi threading models(operating systems)Multi threading models(operating systems)
Multi threading models(operating systems)
jakeer3764
 
Threads
ThreadsThreads
Threads
chrisjosewanjira
 
Multi threaded programming
Multi threaded programmingMulti threaded programming
Multi threaded programming
AnyapuPranav
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
bleh23
 
Assignment-01.pptx
Assignment-01.pptxAssignment-01.pptx
Assignment-01.pptx
HaiderZaman45
 
Basic Threads in Advanced operating system
Basic Threads in Advanced operating systemBasic Threads in Advanced operating system
Basic Threads in Advanced operating system
sidrah29
 
multi-threading
multi-threadingmulti-threading
multi-threading
Ezzat Gul
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
Kumbirai Junior Muzavazi
 
Threads
ThreadsThreads
Threads
Dr. SURBHI SAROHA
 
Threads
ThreadsThreads
Threads
atikkazimca
 
4.Process.ppt
4.Process.ppt4.Process.ppt
4.Process.ppt
AkfeteAssefa
 
Multithreaded Programming in oprating system
Multithreaded Programming in oprating  systemMultithreaded Programming in oprating  system
Multithreaded Programming in oprating system
YOGENDRAMS
 
Topic 4- processes.pptx
Topic 4- processes.pptxTopic 4- processes.pptx
Topic 4- processes.pptx
DanishMahmood23
 
thread os.pptx
thread os.pptxthread os.pptx
thread os.pptx
SANJUSANJEEVTOPPO
 
Concept of thread, multi thread, tcb
Concept of thread, multi thread, tcbConcept of thread, multi thread, tcb
Concept of thread, multi thread, tcb
Kanza batool
 
Networking threads
Networking threadsNetworking threads
Networking threads
Nilesh Pawar
 
Operating System-Thread concept in Operating System
Operating System-Thread concept in Operating SystemOperating System-Thread concept in Operating System
Operating System-Thread concept in Operating System
cscprabh
 
Multi threading models(operating systems)
Multi threading models(operating systems)Multi threading models(operating systems)
Multi threading models(operating systems)
jakeer3764
 
Multi threaded programming
Multi threaded programmingMulti threaded programming
Multi threaded programming
AnyapuPranav
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
bleh23
 
Basic Threads in Advanced operating system
Basic Threads in Advanced operating systemBasic Threads in Advanced operating system
Basic Threads in Advanced operating system
sidrah29
 
multi-threading
multi-threadingmulti-threading
multi-threading
Ezzat Gul
 
Multithreaded Programming in oprating system
Multithreaded Programming in oprating  systemMultithreaded Programming in oprating  system
Multithreaded Programming in oprating system
YOGENDRAMS
 
Ad

More from Salman Memon (20)

PHP Array very Easy Demo
PHP Array very Easy DemoPHP Array very Easy Demo
PHP Array very Easy Demo
Salman Memon
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
Salman Memon
 
How to Use Dreamweaver cs6
How to Use Dreamweaver cs6 How to Use Dreamweaver cs6
How to Use Dreamweaver cs6
Salman Memon
 
what is programming and its clear Concepts to the point
what is programming and its clear Concepts to the point what is programming and its clear Concepts to the point
what is programming and its clear Concepts to the point
Salman Memon
 
Working with variables in PHP
Working with variables in PHPWorking with variables in PHP
Working with variables in PHP
Salman Memon
 
Web forms and html (lect 5)
Web forms and html (lect 5)Web forms and html (lect 5)
Web forms and html (lect 5)
Salman Memon
 
Web forms and html (lect 4)
Web forms and html (lect 4)Web forms and html (lect 4)
Web forms and html (lect 4)
Salman Memon
 
Web forms and html (lect 3)
Web forms and html (lect 3)Web forms and html (lect 3)
Web forms and html (lect 3)
Salman Memon
 
Web forms and html (lect 2)
Web forms and html (lect 2)Web forms and html (lect 2)
Web forms and html (lect 2)
Salman Memon
 
Web forms and html (lect 1)
Web forms and html (lect 1)Web forms and html (lect 1)
Web forms and html (lect 1)
Salman Memon
 
Managing in the Future Enterprise
Managing in the Future EnterpriseManaging in the Future Enterprise
Managing in the Future Enterprise
Salman Memon
 
Overview of Technology Management
Overview of Technology ManagementOverview of Technology Management
Overview of Technology Management
Salman Memon
 
Align Information Technology and Business Strategy
Align Information Technology and Business Strategy Align Information Technology and Business Strategy
Align Information Technology and Business Strategy
Salman Memon
 
WHITE BOX & BLACK BOX TESTING IN DATABASE
WHITE BOX & BLACK BOXTESTING IN DATABASEWHITE BOX & BLACK BOXTESTING IN DATABASE
WHITE BOX & BLACK BOX TESTING IN DATABASE
Salman Memon
 
Email security netwroking
Email security  netwrokingEmail security  netwroking
Email security netwroking
Salman Memon
 
Email security - Netwroking
Email security - Netwroking Email security - Netwroking
Email security - Netwroking
Salman Memon
 
Query decomposition in data base
Query decomposition in data baseQuery decomposition in data base
Query decomposition in data base
Salman Memon
 
Time Management
Time Management Time Management
Time Management
Salman Memon
 
Multimedea device and routes
Multimedea device and routesMultimedea device and routes
Multimedea device and routes
Salman Memon
 
Hash function
Hash function Hash function
Hash function
Salman Memon
 
PHP Array very Easy Demo
PHP Array very Easy DemoPHP Array very Easy Demo
PHP Array very Easy Demo
Salman Memon
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
Salman Memon
 
How to Use Dreamweaver cs6
How to Use Dreamweaver cs6 How to Use Dreamweaver cs6
How to Use Dreamweaver cs6
Salman Memon
 
what is programming and its clear Concepts to the point
what is programming and its clear Concepts to the point what is programming and its clear Concepts to the point
what is programming and its clear Concepts to the point
Salman Memon
 
Working with variables in PHP
Working with variables in PHPWorking with variables in PHP
Working with variables in PHP
Salman Memon
 
Web forms and html (lect 5)
Web forms and html (lect 5)Web forms and html (lect 5)
Web forms and html (lect 5)
Salman Memon
 
Web forms and html (lect 4)
Web forms and html (lect 4)Web forms and html (lect 4)
Web forms and html (lect 4)
Salman Memon
 
Web forms and html (lect 3)
Web forms and html (lect 3)Web forms and html (lect 3)
Web forms and html (lect 3)
Salman Memon
 
Web forms and html (lect 2)
Web forms and html (lect 2)Web forms and html (lect 2)
Web forms and html (lect 2)
Salman Memon
 
Web forms and html (lect 1)
Web forms and html (lect 1)Web forms and html (lect 1)
Web forms and html (lect 1)
Salman Memon
 
Managing in the Future Enterprise
Managing in the Future EnterpriseManaging in the Future Enterprise
Managing in the Future Enterprise
Salman Memon
 
Overview of Technology Management
Overview of Technology ManagementOverview of Technology Management
Overview of Technology Management
Salman Memon
 
Align Information Technology and Business Strategy
Align Information Technology and Business Strategy Align Information Technology and Business Strategy
Align Information Technology and Business Strategy
Salman Memon
 
WHITE BOX & BLACK BOX TESTING IN DATABASE
WHITE BOX & BLACK BOXTESTING IN DATABASEWHITE BOX & BLACK BOXTESTING IN DATABASE
WHITE BOX & BLACK BOX TESTING IN DATABASE
Salman Memon
 
Email security netwroking
Email security  netwrokingEmail security  netwroking
Email security netwroking
Salman Memon
 
Email security - Netwroking
Email security - Netwroking Email security - Netwroking
Email security - Netwroking
Salman Memon
 
Query decomposition in data base
Query decomposition in data baseQuery decomposition in data base
Query decomposition in data base
Salman Memon
 
Multimedea device and routes
Multimedea device and routesMultimedea device and routes
Multimedea device and routes
Salman Memon
 

Recently uploaded (20)

HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 

Os Threads

  • 2. INTRODUCTION A thread is contained inside a process and different threads in the same process share some resources (most commonly memory), while different processes do not. Process and threads
  • 3. INTRODUCTION A thread is a basic unit of CPU utilization, consisting of a program counter, a stack, and a set of registers, ( and a thread ID. ) On a single processor, multithreading generally occurs by as in multitasking, the processor switches between different threads. On a multiprocessor or multi-core system, the threads or tasks actually do run at the same time, with each processor or core running a particular thread or task
  • 5. Single Thread ◦Has single thread of control ◦It allows the process to perform only 1 task at a time. Multi thread ◦Has many threads ◦Simultaneous execution of different task
  • 6. BENEFITS Take less time to create a new tread than a process. Less time to terminate a tread than a presses. less time to switch between two treads within the same process. Hence treads within the same process share memory and files, they can communicate with each other without invoking the kernel. Responsiveness. Resource sharing . Economy. Utilization of MP Architectures.
  • 7. User Threads Thread management done by user-level threads library ◦Thread creation, scheduling, are done in user level Fast to create and manage Drawback: ◦If kernel is single thread, then user level thread performing a blocking system call will cause entire process to block
  • 8. KERNEL THREAD Supported by OS ◦Thread creation, scheduling, are done in user level by kernel Thread management is performed by os, thus kernel thread are slow. If thread perform blocking system call, kernel can schedule another thread in application for execution
  • 9. Multithreading Models (In a specific implementation, the user threads must be mapped to kernel threads, using one of the following strategies. ) Many-to-One One-to-One Many-to-Many
  • 10. MANY-TO-ONEmany user-level threads are all mapped onto a single kernel thread. Thread management is handled by the thread library in user space, which is very efficient. if a blocking system call is made, then the entire process blocks, even if the other user threads would otherwise be able to continue. Ex: Green threads for Solaris and GNU Portable
  • 11. ONE-TO-ONE MODEL Each user-level thread maps to kernel thread Allow anther thread to run if block Run parallel Drawback: along with user thread kernel thread shld be created. Ex: Linux and Windows from 95 to XP
  • 12. MANY-TO-MANY The many-to-many model multiplexes any number of user threads onto an equal or smaller number of kernel threads, combining the best features of the one-to-one and many-to-one models. Blocking kernel system calls do not block the entire process. Individual processes may be allocated variable numbers of kernel threads, depending on the number of CPUs present and other factors. Ex: RIX, HP-UX, and Tru64 UNIX
  • 13. Thread Libraries Thread libraries provide programmers with an API for creating and managing threads. Thread libraries may be implemented either in user space or in kernel space. There are three main thread libraries in use today:  POSIX Pthreads . Win32 threads. Java threads .
  • 14. Pthreads May be provided either as user-level or kernel-level. A POSIX standard (IEEE 1003.1c) API for thread creation and synchronization. API specifies behavior of the thread library, implementation is up to development of the library. Common in UNIX operating systems (Solaris, Linux, Mac OS X).
  • 15. Linux Threads Linux refers to them as tasks rather than threads. Thread creation is done through clone() system call. clone() allows a child task to share the address space of the parent task (process).