SlideShare a Scribd company logo
Submitted by
Kiran Patel
What is Thread
A thread is a portion of code that may be executed
independently of the main program.
For example, a program may have an open thread waiting
for a specific event to occur or running a separate job,
allowing the main program to perform other tasks.
A program is capable of having multiple threads open at
once and will either terminate or suspend them after a task
is completed, or the program is closed.
Type of Thread
There are two type of thread:-
Single Thread
Multiple thread
Single Thread:-
A single-thread, only one task can be done at a time and the program
waits until a task is finished before starting another one.
Multiple thread:-
A process with two threads of execution, running on a single
processor
Benefits
Responsiveness
Resource Sharing
Economy
Scalability
Responsiveness:-
Multithreading an interactive application may allow a program to
continue running even if it is blocked or is performing a lengthy
operating, increasing responsiveness to the user.
Resource Sharing-
Thread share resource of process, easier than shared memory or
message passing.
Economy:- cheaper than process creation, thread switching lower
overhead than context switching.
Scalability:- process can take advantage of multiprocessor. The
multithreading can be greatly increased in a multiprocessor
architecture.
User Threads and kernel thread
User Level Threads -- User managed threads
Kernel Level Threads -- Operating System managed threads acting on
kernel, an operating system core.
User Level Threads:-
In this case, application manages thread management kernel is not
aware of the existence of threads.
The thread library contains code for creating and destroying threads, for
passing message and data between threads, for scheduling thread
execution
Kernel Level Threads:-
Thread management done by the Kernel.
There is no thread management code in the application area.
 Kernel threads are supported directly by the operating system.
Any application can be programmed to be multithreaded.
Multithreading Models
Some operating system provide a combined user level
thread and Kernel level thread facility. Solaris is a good
example of this combined approach.
Multithreading models are three types
Many to many relationship.
Many to one relationship.
One to one relationship.
Many to Many Model
Many to One Model
One to One Model
Difference between User Level &
Kernel Level Thread
• User Level Threads
• User level threads are
faster to create and
manage.
• Implementation is by
a thread library at the
user level.
• Kernel Level Thread
• Kernel level threads
are slower to create
and manage.
• Operating system
supports creation of
Kernel threads.
• User level thread is
generic and can run
on any operating
system.
• Multi-threaded
application cannot
take advantage of
multiprocessing.
• Kernel level thread is
specific to the
operating system.
• Kernel routines
themselves can be
multithreaded.
Ad

More Related Content

What's hot (20)

Operating system: threads(mulithreading,benefits of threads, types of thread)
Operating system: threads(mulithreading,benefits of threads, types of thread)Operating system: threads(mulithreading,benefits of threads, types of thread)
Operating system: threads(mulithreading,benefits of threads, types of thread)
sonuu__
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
Opersys inc.
 
Accessing Hardware on Android
Accessing Hardware on AndroidAccessing Hardware on Android
Accessing Hardware on Android
Gary Bisson
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
Macpaul Lin
 
Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)
Emertxe Information Technologies Pvt Ltd
 
OS Process and Thread Concepts
OS Process and Thread ConceptsOS Process and Thread Concepts
OS Process and Thread Concepts
sgpraju
 
Process management in os
Process management in osProcess management in os
Process management in os
Sumant Diwakar
 
Monolithic kernel
Monolithic kernelMonolithic kernel
Monolithic kernel
ARAVIND18MCS1004
 
Linux basics
Linux basicsLinux basics
Linux basics
Santosh Khadsare
 
Parallelism
ParallelismParallelism
Parallelism
Md Raseduzzaman
 
Rt linux-lab1
Rt linux-lab1Rt linux-lab1
Rt linux-lab1
JOLLUSUDARSHANREDDY
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and Properties
Saadi Rahman
 
Hubungan hardware dengan kernel, shell, user
Hubungan hardware dengan kernel, shell, userHubungan hardware dengan kernel, shell, user
Hubungan hardware dengan kernel, shell, user
Ryandika Alfarishi
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
RuggedBoardGroup
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
Emertxe Information Technologies Pvt Ltd
 
Why do People Prefer Using Open Source Software?
Why do People Prefer Using Open Source Software?Why do People Prefer Using Open Source Software?
Why do People Prefer Using Open Source Software?
david rom
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
Emertxe Information Technologies Pvt Ltd
 
Android device driver structure introduction
Android device driver structure introductionAndroid device driver structure introduction
Android device driver structure introduction
William Liang
 
BusyBox for Embedded Linux
BusyBox for Embedded LinuxBusyBox for Embedded Linux
BusyBox for Embedded Linux
Emertxe Information Technologies Pvt Ltd
 
Ndu06 typesof language
Ndu06 typesof languageNdu06 typesof language
Ndu06 typesof language
nicky_walters
 
Operating system: threads(mulithreading,benefits of threads, types of thread)
Operating system: threads(mulithreading,benefits of threads, types of thread)Operating system: threads(mulithreading,benefits of threads, types of thread)
Operating system: threads(mulithreading,benefits of threads, types of thread)
sonuu__
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
Opersys inc.
 
Accessing Hardware on Android
Accessing Hardware on AndroidAccessing Hardware on Android
Accessing Hardware on Android
Gary Bisson
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
Macpaul Lin
 
OS Process and Thread Concepts
OS Process and Thread ConceptsOS Process and Thread Concepts
OS Process and Thread Concepts
sgpraju
 
Process management in os
Process management in osProcess management in os
Process management in os
Sumant Diwakar
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and Properties
Saadi Rahman
 
Hubungan hardware dengan kernel, shell, user
Hubungan hardware dengan kernel, shell, userHubungan hardware dengan kernel, shell, user
Hubungan hardware dengan kernel, shell, user
Ryandika Alfarishi
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
RuggedBoardGroup
 
Why do People Prefer Using Open Source Software?
Why do People Prefer Using Open Source Software?Why do People Prefer Using Open Source Software?
Why do People Prefer Using Open Source Software?
david rom
 
Android device driver structure introduction
Android device driver structure introductionAndroid device driver structure introduction
Android device driver structure introduction
William Liang
 
Ndu06 typesof language
Ndu06 typesof languageNdu06 typesof language
Ndu06 typesof language
nicky_walters
 

Similar to Thread (Operating System) (20)

Thread
ThreadThread
Thread
dharini waghela
 
Multi threaded programming
Multi threaded programmingMulti threaded programming
Multi threaded programming
AnyapuPranav
 
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
 
Threads ppt
Threads pptThreads ppt
Threads ppt
panchaldev1
 
Thread
ThreadThread
Thread
A. S. M. Shafi
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
Kumbirai Junior Muzavazi
 
W-9.pptx
W-9.pptxW-9.pptx
W-9.pptx
alianwarr
 
threads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptxthreads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptx
piyushlohia1857
 
Threads lecture slides for operating systems
Threads lecture slides for operating systemsThreads lecture slides for operating systems
Threads lecture slides for operating systems
amirtarek401
 
thread os.pptx
thread os.pptxthread os.pptx
thread os.pptx
SANJUSANJEEVTOPPO
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
Prakhar Maurya
 
Threads .ppt
Threads .pptThreads .ppt
Threads .ppt
meet darji
 
Operating system 20 threads
Operating system 20 threadsOperating system 20 threads
Operating system 20 threads
Vaibhav Khanna
 
J threads-pdf
J threads-pdfJ threads-pdf
J threads-pdf
Venketesh Babu
 
Epc 3.ppt
Epc 3.pptEpc 3.ppt
Epc 3.ppt
CasmoletJ
 
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
 
dos slide share.pptx
dos slide share.pptxdos slide share.pptx
dos slide share.pptx
NagaVarthini
 
Mulitthread
MulitthreadMulitthread
Mulitthread
DeepaR42
 
Java Thread & Multithreading
Java Thread & MultithreadingJava Thread & Multithreading
Java Thread & Multithreading
jehan1987
 
Threads
ThreadsThreads
Threads
chrisjosewanjira
 
Multi threaded programming
Multi threaded programmingMulti threaded programming
Multi threaded programming
AnyapuPranav
 
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
 
threads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptxthreads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptx
piyushlohia1857
 
Threads lecture slides for operating systems
Threads lecture slides for operating systemsThreads lecture slides for operating systems
Threads lecture slides for operating systems
amirtarek401
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
Prakhar Maurya
 
Operating system 20 threads
Operating system 20 threadsOperating system 20 threads
Operating system 20 threads
Vaibhav Khanna
 
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
 
dos slide share.pptx
dos slide share.pptxdos slide share.pptx
dos slide share.pptx
NagaVarthini
 
Mulitthread
MulitthreadMulitthread
Mulitthread
DeepaR42
 
Java Thread & Multithreading
Java Thread & MultithreadingJava Thread & Multithreading
Java Thread & Multithreading
jehan1987
 
Ad

More from kiran Patel (11)

2017 Union budget of India
2017 Union budget of India 2017 Union budget of India
2017 Union budget of India
kiran Patel
 
C++ concept of Polymorphism
C++ concept of  PolymorphismC++ concept of  Polymorphism
C++ concept of Polymorphism
kiran Patel
 
Database Management System( Normalization)
Database Management System( Normalization)Database Management System( Normalization)
Database Management System( Normalization)
kiran Patel
 
B tree (computer Science)
B tree (computer Science)B tree (computer Science)
B tree (computer Science)
kiran Patel
 
Effort estimation( software Engineering)
Effort estimation( software Engineering)Effort estimation( software Engineering)
Effort estimation( software Engineering)
kiran Patel
 
Library management (use case diagram Software engineering)
Library management (use case  diagram Software engineering)Library management (use case  diagram Software engineering)
Library management (use case diagram Software engineering)
kiran Patel
 
Brain Computer Interface
Brain Computer InterfaceBrain Computer Interface
Brain Computer Interface
kiran Patel
 
Artificial Inteligence
Artificial InteligenceArtificial Inteligence
Artificial Inteligence
kiran Patel
 
Smart buckets ppt
Smart buckets pptSmart buckets ppt
Smart buckets ppt
kiran Patel
 
Linked list using Dynamic Memory Allocation
Linked list using Dynamic Memory AllocationLinked list using Dynamic Memory Allocation
Linked list using Dynamic Memory Allocation
kiran Patel
 
Dynamic memory Allocation in c language
Dynamic memory Allocation in c languageDynamic memory Allocation in c language
Dynamic memory Allocation in c language
kiran Patel
 
2017 Union budget of India
2017 Union budget of India 2017 Union budget of India
2017 Union budget of India
kiran Patel
 
C++ concept of Polymorphism
C++ concept of  PolymorphismC++ concept of  Polymorphism
C++ concept of Polymorphism
kiran Patel
 
Database Management System( Normalization)
Database Management System( Normalization)Database Management System( Normalization)
Database Management System( Normalization)
kiran Patel
 
B tree (computer Science)
B tree (computer Science)B tree (computer Science)
B tree (computer Science)
kiran Patel
 
Effort estimation( software Engineering)
Effort estimation( software Engineering)Effort estimation( software Engineering)
Effort estimation( software Engineering)
kiran Patel
 
Library management (use case diagram Software engineering)
Library management (use case  diagram Software engineering)Library management (use case  diagram Software engineering)
Library management (use case diagram Software engineering)
kiran Patel
 
Brain Computer Interface
Brain Computer InterfaceBrain Computer Interface
Brain Computer Interface
kiran Patel
 
Artificial Inteligence
Artificial InteligenceArtificial Inteligence
Artificial Inteligence
kiran Patel
 
Smart buckets ppt
Smart buckets pptSmart buckets ppt
Smart buckets ppt
kiran Patel
 
Linked list using Dynamic Memory Allocation
Linked list using Dynamic Memory AllocationLinked list using Dynamic Memory Allocation
Linked list using Dynamic Memory Allocation
kiran Patel
 
Dynamic memory Allocation in c language
Dynamic memory Allocation in c languageDynamic memory Allocation in c language
Dynamic memory Allocation in c language
kiran Patel
 
Ad

Recently uploaded (20)

Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptxData Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E..."Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
Infopitaara
 
The Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLabThe Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLab
Journal of Soft Computing in Civil Engineering
 
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Journal of Soft Computing in Civil Engineering
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Journal of Soft Computing in Civil Engineering
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
theory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptxtheory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptxData Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E..."Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
Infopitaara
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
theory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptxtheory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 

Thread (Operating System)

  • 2. What is Thread A thread is a portion of code that may be executed independently of the main program. For example, a program may have an open thread waiting for a specific event to occur or running a separate job, allowing the main program to perform other tasks. A program is capable of having multiple threads open at once and will either terminate or suspend them after a task is completed, or the program is closed.
  • 3. Type of Thread There are two type of thread:- Single Thread Multiple thread
  • 4. Single Thread:- A single-thread, only one task can be done at a time and the program waits until a task is finished before starting another one.
  • 5. Multiple thread:- A process with two threads of execution, running on a single processor
  • 7. Responsiveness:- Multithreading an interactive application may allow a program to continue running even if it is blocked or is performing a lengthy operating, increasing responsiveness to the user. Resource Sharing- Thread share resource of process, easier than shared memory or message passing.
  • 8. Economy:- cheaper than process creation, thread switching lower overhead than context switching. Scalability:- process can take advantage of multiprocessor. The multithreading can be greatly increased in a multiprocessor architecture.
  • 9. User Threads and kernel thread User Level Threads -- User managed threads Kernel Level Threads -- Operating System managed threads acting on kernel, an operating system core.
  • 10. User Level Threads:- In this case, application manages thread management kernel is not aware of the existence of threads. The thread library contains code for creating and destroying threads, for passing message and data between threads, for scheduling thread execution
  • 11. Kernel Level Threads:- Thread management done by the Kernel. There is no thread management code in the application area.  Kernel threads are supported directly by the operating system. Any application can be programmed to be multithreaded.
  • 12. Multithreading Models Some operating system provide a combined user level thread and Kernel level thread facility. Solaris is a good example of this combined approach.
  • 13. Multithreading models are three types Many to many relationship. Many to one relationship. One to one relationship.
  • 14. Many to Many Model
  • 15. Many to One Model
  • 16. One to One Model
  • 17. Difference between User Level & Kernel Level Thread • User Level Threads • User level threads are faster to create and manage. • Implementation is by a thread library at the user level. • Kernel Level Thread • Kernel level threads are slower to create and manage. • Operating system supports creation of Kernel threads.
  • 18. • User level thread is generic and can run on any operating system. • Multi-threaded application cannot take advantage of multiprocessing. • Kernel level thread is specific to the operating system. • Kernel routines themselves can be multithreaded.