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.

More Related Content

What's hot

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__
 
Threads
ThreadsThreads
Threads
atikkazimca
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating Systems
Nitish Gulati
 
Ch4 Threads
Ch4 ThreadsCh4 Threads
Ch4 Threads
mayacendana
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
Kumbirai Junior Muzavazi
 
Thread
ThreadThread
Thread
Mohd Arif
 
Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
Sonali Chauhan
 
Multi threaded programming
Multi threaded programmingMulti threaded programming
Multi threaded programming
AnyapuPranav
 
OS_Ch5
OS_Ch5OS_Ch5
Threads
ThreadsThreads
Threads
Shivam Singh
 
4 threads
4 threads4 threads
4 threads
Dr. Loganathan R
 
Thread
ThreadThread
Multithreading models.ppt
Multithreading models.pptMultithreading models.ppt
Multithreading models.ppt
Luis Goldster
 
Chapter 4 - Threads
Chapter 4 - ThreadsChapter 4 - Threads
Chapter 4 - Threads
Wayne Jones Jnr
 
Multi threading model
Multi threading modelMulti threading model
Multi threading model
annalakshmir2
 
Operating System Chapter 4 Multithreaded programming
Operating System Chapter 4 Multithreaded programmingOperating System Chapter 4 Multithreaded programming
Operating System Chapter 4 Multithreaded programming
guesta40f80
 
Thread management
Thread management Thread management
Thread management
Ayaan Adeel
 
Thread
ThreadThread
Thread
ThreadThread
Os Threads
Os ThreadsOs Threads
Os Threads
Salman Memon
 

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)
 
Threads
ThreadsThreads
Threads
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating Systems
 
Ch4 Threads
Ch4 ThreadsCh4 Threads
Ch4 Threads
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
 
Thread
ThreadThread
Thread
 
Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
 
Multi threaded programming
Multi threaded programmingMulti threaded programming
Multi threaded programming
 
OS_Ch5
OS_Ch5OS_Ch5
OS_Ch5
 
Threads
ThreadsThreads
Threads
 
4 threads
4 threads4 threads
4 threads
 
Thread
ThreadThread
Thread
 
Multithreading models.ppt
Multithreading models.pptMultithreading models.ppt
Multithreading models.ppt
 
Chapter 4 - Threads
Chapter 4 - ThreadsChapter 4 - Threads
Chapter 4 - Threads
 
Multi threading model
Multi threading modelMulti threading model
Multi threading model
 
Operating System Chapter 4 Multithreaded programming
Operating System Chapter 4 Multithreaded programmingOperating System Chapter 4 Multithreaded programming
Operating System Chapter 4 Multithreaded programming
 
Thread management
Thread management Thread management
Thread management
 
Thread
ThreadThread
Thread
 
Thread
ThreadThread
Thread
 
Os Threads
Os ThreadsOs Threads
Os Threads
 

Similar to Thread (Operating System)

Threads ppt
Threads pptThreads ppt
Threads ppt
panchaldev1
 
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
 
thread os.pptx
thread os.pptxthread os.pptx
thread os.pptx
SANJUSANJEEVTOPPO
 
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
Wiki 2
Wiki 2Wiki 2
Wiki 2
Sid Hegde
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
bleh23
 
Threads
ThreadsThreads
Threads
SURBHI SAROHA
 
Multithreading
MultithreadingMultithreading
Multithreading
A. S. M. Shafi
 
Multi threading models(operating systems)
Multi threading models(operating systems)Multi threading models(operating systems)
Multi threading models(operating systems)
jakeer3764
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
Suvendu Kumar Dash
 
Threads.ppt
Threads.pptThreads.ppt
Threads.ppt
amadayshwan
 
Operating Systems - "Chapter 4: Multithreaded Programming"
Operating Systems - "Chapter 4:  Multithreaded Programming"Operating Systems - "Chapter 4:  Multithreaded Programming"
Operating Systems - "Chapter 4: Multithreaded Programming"
Ra'Fat Al-Msie'deen
 

Similar to Thread (Operating System) (20)

Threads ppt
Threads pptThreads ppt
Threads ppt
 
W-9.pptx
W-9.pptxW-9.pptx
W-9.pptx
 
threads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptxthreads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptx
 
thread os.pptx
thread os.pptxthread os.pptx
thread os.pptx
 
Operating system 20 threads
Operating system 20 threadsOperating system 20 threads
Operating system 20 threads
 
J threads-pdf
J threads-pdfJ threads-pdf
J threads-pdf
 
Epc 3.ppt
Epc 3.pptEpc 3.ppt
Epc 3.ppt
 
Concept of thread, multi thread, tcb
Concept of thread, multi thread, tcbConcept of thread, multi thread, tcb
Concept of thread, multi thread, tcb
 
dos slide share.pptx
dos slide share.pptxdos slide share.pptx
dos slide share.pptx
 
Mulitthread
MulitthreadMulitthread
Mulitthread
 
Java Thread & Multithreading
Java Thread & MultithreadingJava Thread & Multithreading
Java Thread & Multithreading
 
Threads
ThreadsThreads
Threads
 
Wiki 2
Wiki 2Wiki 2
Wiki 2
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
 
Threads
ThreadsThreads
Threads
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Multi threading models(operating systems)
Multi threading models(operating systems)Multi threading models(operating systems)
Multi threading models(operating systems)
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Threads.ppt
Threads.pptThreads.ppt
Threads.ppt
 
Operating Systems - "Chapter 4: Multithreaded Programming"
Operating Systems - "Chapter 4:  Multithreaded Programming"Operating Systems - "Chapter 4:  Multithreaded Programming"
Operating Systems - "Chapter 4: Multithreaded Programming"
 

More from 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
 

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
 
C++ concept of Polymorphism
C++ concept of  PolymorphismC++ concept of  Polymorphism
C++ concept of Polymorphism
 
Database Management System( Normalization)
Database Management System( Normalization)Database Management System( Normalization)
Database Management System( Normalization)
 
B tree (computer Science)
B tree (computer Science)B tree (computer Science)
B tree (computer Science)
 
Effort estimation( software Engineering)
Effort estimation( software Engineering)Effort estimation( software Engineering)
Effort estimation( software Engineering)
 
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)
 
Brain Computer Interface
Brain Computer InterfaceBrain Computer Interface
Brain Computer Interface
 
Artificial Inteligence
Artificial InteligenceArtificial Inteligence
Artificial Inteligence
 
Smart buckets ppt
Smart buckets pptSmart buckets ppt
Smart buckets ppt
 
Linked list using Dynamic Memory Allocation
Linked list using Dynamic Memory AllocationLinked list using Dynamic Memory Allocation
Linked list using Dynamic Memory Allocation
 
Dynamic memory Allocation in c language
Dynamic memory Allocation in c languageDynamic memory Allocation in c language
Dynamic memory Allocation in c language
 

Recently uploaded

Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
MuhammadJazib15
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
Kamal Acharya
 
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
Kuvempu University
 
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
GiselleginaGloria
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
b0754201
 
Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...
Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...
Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...
IJCNCJournal
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
Indrajeet sahu
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
Beckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview PresentationBeckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview Presentation
VanTuDuong1
 
Properties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure MeasurementProperties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure Measurement
Indrajeet sahu
 
309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf
309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf
309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf
Sou Tibon
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
Paris Salesforce Developer Group
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
upoux
 
paper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdfpaper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdf
ShurooqTaib
 
Introduction to Artificial Intelligence.
Introduction to Artificial Intelligence.Introduction to Artificial Intelligence.
Introduction to Artificial Intelligence.
supriyaDicholkar1
 
Unit -II Spectroscopy - EC I B.Tech.pdf
Unit -II Spectroscopy - EC  I B.Tech.pdfUnit -II Spectroscopy - EC  I B.Tech.pdf
Unit -II Spectroscopy - EC I B.Tech.pdf
TeluguBadi
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
PreethaV16
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
ijseajournal
 
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASICINTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
GOKULKANNANMMECLECTC
 

Recently uploaded (20)

Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
 
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
 
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
 
Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...
Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...
Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
Beckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview PresentationBeckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview Presentation
 
Properties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure MeasurementProperties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure Measurement
 
309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf
309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf
309475979-Creativity-Innovation-notes-IV-Sem-2016-pdf.pdf
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
 
paper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdfpaper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdf
 
Introduction to Artificial Intelligence.
Introduction to Artificial Intelligence.Introduction to Artificial Intelligence.
Introduction to Artificial Intelligence.
 
Unit -II Spectroscopy - EC I B.Tech.pdf
Unit -II Spectroscopy - EC  I B.Tech.pdfUnit -II Spectroscopy - EC  I B.Tech.pdf
Unit -II Spectroscopy - EC I B.Tech.pdf
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
 
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASICINTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
 

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.