ๅฐŠๆ•ฌ็š„ ๅพฎไฟกๆฑ‡็Ž‡๏ผš1ๅ†† โ‰ˆ 0.046166 ๅ…ƒ ๆ”ฏไป˜ๅฎๆฑ‡็Ž‡๏ผš1ๅ†† โ‰ˆ 0.046257ๅ…ƒ [้€€ๅ‡บ็™ปๅฝ•]
SlideShare a Scribd company logo
THREADS..
Panchal Dev.
M.Tech in Cyber Security.
What is Threads..?
๏‚ด A thread is flow of execution through the process code, with
its own program counter, system register & stack.
๏‚ด A thread is also called a light weight process.
๏‚ด Threads provide a way to improve application performance
through parallelism.
๏‚ด Each thread belongs to exactly one process and no thread
can exist outside a process.
PROCESS. THREADS.
Process is heavy weight. Threads is light weight.
Process Switching needs interaction with
operating system.
Threads switching does not need to interact
with operating system.
If one process is blocked then no other
process can execute until the first process is
unblocked.
While one threads is blocked and waiting, a
second thread in the same task can run.
Multiprocesses without using threads use
more resource.
One thread can read, write or change
thread's data.
๏‚ด Advantages of Threads:
1. Provide better performance.
2. Allow any program to perform multiple task at once.
๏‚ด Disadvantages of Threads:
1. Blocking of parent threads will stop all child process.
TYPES OF THREADS..
๏‚ด Threads are implemented in following two ways:
1. User Level Threads. ( ULT ).
2. Kernel Level Threads. ( KLT ).
User Level Threads. ( ULT )
๏‚ด User level threads implement in user level libraries, so threads switching
does not need to call operating system and to cause interrupt to the
kernel.
๏‚ด In fact, the kernel knows nothing about user level threads and manages
them as if they were single-threaded process.
๏‚ด Advantage of User level threads.
1. Easy to represent and manage.
2. User level thread can run on any operation system.
3. User level threads are fast and efficient.
๏‚ด Disadvantages:
1. There is a lack of coordination between threads and operating system kernel.
Kernel Level Threads..
๏‚ด In this method, the kernel knows about and manages the threads, No
runtime system is needed in this case.
๏‚ด Operating system kernel provides system call to create and manages
threads.
๏‚ด Advantages of Kernel level Threads:
1. Kernel can simultaneously schedule multiple threads from the same process on multiple
process.
2. If one thread in a process is blocked the kernel can schedule another thread of same
process.
๏‚ด Disadvantages:
1. Kernel threads are generally slower to create and manages than the user threads.
USER LEVEL THREADS: KERNEL LEVEL THREADS:
User level threads are faster to creates and
manages.
Kernel level threads are slower to creates
and manage.
Implementation is by a thread library at the
user level.
Operating system supports creation of
kernel threads.
User level threads is generic and can run
any operating system.
Kernel level threads is specific to the
operating system.
Multi threaded applications cannot take
advantages of multiprocessing.
Kernel routines themselves can be
multithreaded.
Multithreading Models:
๏‚ด The user threads must be mapped to kernel threads using on of the
following strategies:
1. Many to One model.
2. One to One model.
3. Many to Many model.
Many to One:
๏‚ด In many to one model many user level threads are mapped to one kernel
threads.
๏‚ด Only one thread can access the kernel at a time, so it cannot run in parallel on
Multiprocessor.
One to One:
๏‚ด In one to one model, each user threads mapped to a kernel threads.
๏‚ด It provides more concurrency because it allows another thread to execute if a
thread makes a blocking system calls.
๏‚ด Each user threads requires a kernel thread that may affect the performance of the
system.
Many to many:
๏‚ด This model multiplexes many user level threads to a smaller or equal numbers of
kernel threads.
๏‚ด The kernel can execute another threads if a threads makes a blocking system call.
๏‚ดTHANK YOUโ€ฆ

More Related Content

What's hot

Deadlock Avoidance - OS
Deadlock Avoidance - OSDeadlock Avoidance - OS
Deadlock Avoidance - OS
MsAnita2
ย 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidance
wahab13
ย 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
Shashank Kapoor
ย 
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
ย 
Deadlock
DeadlockDeadlock
Deadlock
Mayuri Verma
ย 
Multithreading
MultithreadingMultithreading
Multithreading
A B Shinde
ย 
Multi Processors And Multi Computers
 Multi Processors And Multi Computers Multi Processors And Multi Computers
Multi Processors And Multi Computers
Nemwos
ย 
Multi core-architecture
Multi core-architectureMulti core-architecture
Multi core-architecture
Piyush Mittal
ย 
Cs8493 unit 2
Cs8493 unit 2Cs8493 unit 2
Cs8493 unit 2
Kathirvel Ayyaswamy
ย 
Naming in Distributed Systems
Naming in Distributed SystemsNaming in Distributed Systems
Naming in Distributed Systems
Nandakumar P
ย 
file sharing semantics by Umar Danjuma Maiwada
file sharing semantics by Umar Danjuma Maiwada file sharing semantics by Umar Danjuma Maiwada
file sharing semantics by Umar Danjuma Maiwada
umardanjumamaiwada
ย 
Threads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess CommunicationThreads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess Communication
Shivam Mitra
ย 
30326851 -operating-system-unit-1-ppt
30326851 -operating-system-unit-1-ppt30326851 -operating-system-unit-1-ppt
30326851 -operating-system-unit-1-ppt
raj732723
ย 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithms
Shanu Kumar
ย 
Process of operating system
Process of operating systemProcess of operating system
Reader/writer problem
Reader/writer problemReader/writer problem
Reader/writer problem
RinkuMonani
ย 
Distributed shared memory shyam soni
Distributed shared memory shyam soniDistributed shared memory shyam soni
Distributed shared memory shyam soni
Shyam Soni
ย 
Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
MNM Jain Engineering College
ย 
Case study windows
Case study windowsCase study windows
Case study windows
Padam Banthia
ย 
Files
FilesFiles
Files
kirtidhamija16
ย 

What's hot (20)

Deadlock Avoidance - OS
Deadlock Avoidance - OSDeadlock Avoidance - OS
Deadlock Avoidance - OS
ย 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidance
ย 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
ย 
Operating Systems - "Chapter 4: Multithreaded Programming"
Operating Systems - "Chapter 4:  Multithreaded Programming"Operating Systems - "Chapter 4:  Multithreaded Programming"
Operating Systems - "Chapter 4: Multithreaded Programming"
ย 
Deadlock
DeadlockDeadlock
Deadlock
ย 
Multithreading
MultithreadingMultithreading
Multithreading
ย 
Multi Processors And Multi Computers
 Multi Processors And Multi Computers Multi Processors And Multi Computers
Multi Processors And Multi Computers
ย 
Multi core-architecture
Multi core-architectureMulti core-architecture
Multi core-architecture
ย 
Cs8493 unit 2
Cs8493 unit 2Cs8493 unit 2
Cs8493 unit 2
ย 
Naming in Distributed Systems
Naming in Distributed SystemsNaming in Distributed Systems
Naming in Distributed Systems
ย 
file sharing semantics by Umar Danjuma Maiwada
file sharing semantics by Umar Danjuma Maiwada file sharing semantics by Umar Danjuma Maiwada
file sharing semantics by Umar Danjuma Maiwada
ย 
Threads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess CommunicationThreads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess Communication
ย 
30326851 -operating-system-unit-1-ppt
30326851 -operating-system-unit-1-ppt30326851 -operating-system-unit-1-ppt
30326851 -operating-system-unit-1-ppt
ย 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithms
ย 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
ย 
Reader/writer problem
Reader/writer problemReader/writer problem
Reader/writer problem
ย 
Distributed shared memory shyam soni
Distributed shared memory shyam soniDistributed shared memory shyam soni
Distributed shared memory shyam soni
ย 
Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
ย 
Case study windows
Case study windowsCase study windows
Case study windows
ย 
Files
FilesFiles
Files
ย 

Similar to Threads ppt

Thread
ThreadThread
Thread
dharini waghela
ย 
threads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptxthreads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptx
piyushlohia1857
ย 
Multi threaded programming
Multi threaded programmingMulti threaded programming
Multi threaded programming
AnyapuPranav
ย 
Thread
ThreadThread
Thread
A. S. M. Shafi
ย 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
Prakhar Maurya
ย 
thread os.pptx
thread os.pptxthread os.pptx
thread os.pptx
SANJUSANJEEVTOPPO
ย 
Threads .ppt
Threads .pptThreads .ppt
Threads .ppt
meet darji
ย 
Thread (Operating System)
Thread  (Operating System)Thread  (Operating System)
Thread (Operating System)
kiran Patel
ย 
Networking threads
Networking threadsNetworking threads
Networking threads
Nilesh Pawar
ย 
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
ย 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
Kumbirai Junior Muzavazi
ย 
dos slide share.pptx
dos slide share.pptxdos slide share.pptx
dos slide share.pptx
NagaVarthini
ย 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
bleh23
ย 
THREADS of Operating System by Noman Zahid
THREADS of Operating System by Noman Zahid THREADS of Operating System by Noman Zahid
THREADS of Operating System by Noman Zahid
noman zahid
ย 
threads and its types ....in operating system ..
threads and its types ....in operating system ..threads and its types ....in operating system ..
threads and its types ....in operating system ..
Nimrakhan89
ย 
Threads
ThreadsThreads
Threads
chrisjosewanjira
ย 
Threads
ThreadsThreads
Threads
atikkazimca
ย 
THREADS IN OPERATING SYSTEM BIKASH.pptx
THREADS IN OPERATING SYSTEM BIKASH.pptxTHREADS IN OPERATING SYSTEM BIKASH.pptx
THREADS IN OPERATING SYSTEM BIKASH.pptx
DevishreeRout
ย 
4.Process.ppt
4.Process.ppt4.Process.ppt
4.Process.ppt
AkfeteAssefa
ย 
Thread
ThreadThread
Thread
Sajid Hussain
ย 

Similar to Threads ppt (20)

Thread
ThreadThread
Thread
ย 
threads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptxthreads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptx
ย 
Multi threaded programming
Multi threaded programmingMulti threaded programming
Multi threaded programming
ย 
Thread
ThreadThread
Thread
ย 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
ย 
thread os.pptx
thread os.pptxthread os.pptx
thread os.pptx
ย 
Threads .ppt
Threads .pptThreads .ppt
Threads .ppt
ย 
Thread (Operating System)
Thread  (Operating System)Thread  (Operating System)
Thread (Operating System)
ย 
Networking threads
Networking threadsNetworking threads
Networking threads
ย 
Concept of thread, multi thread, tcb
Concept of thread, multi thread, tcbConcept of thread, multi thread, tcb
Concept of thread, multi thread, tcb
ย 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
ย 
dos slide share.pptx
dos slide share.pptxdos slide share.pptx
dos slide share.pptx
ย 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
ย 
THREADS of Operating System by Noman Zahid
THREADS of Operating System by Noman Zahid THREADS of Operating System by Noman Zahid
THREADS of Operating System by Noman Zahid
ย 
threads and its types ....in operating system ..
threads and its types ....in operating system ..threads and its types ....in operating system ..
threads and its types ....in operating system ..
ย 
Threads
ThreadsThreads
Threads
ย 
Threads
ThreadsThreads
Threads
ย 
THREADS IN OPERATING SYSTEM BIKASH.pptx
THREADS IN OPERATING SYSTEM BIKASH.pptxTHREADS IN OPERATING SYSTEM BIKASH.pptx
THREADS IN OPERATING SYSTEM BIKASH.pptx
ย 
4.Process.ppt
4.Process.ppt4.Process.ppt
4.Process.ppt
ย 
Thread
ThreadThread
Thread
ย 

Recently uploaded

Erasmus + DISSEMINATION ACTIVITIES Croatia
Erasmus + DISSEMINATION ACTIVITIES CroatiaErasmus + DISSEMINATION ACTIVITIES Croatia
Erasmus + DISSEMINATION ACTIVITIES Croatia
whatchangedhowreflec
ย 
IoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdfIoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdf
roshanranjit222
ย 
220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science
Kalna College
ย 
The Rise of the Digital Telecommunication Marketplace.pptx
The Rise of the Digital Telecommunication Marketplace.pptxThe Rise of the Digital Telecommunication Marketplace.pptx
The Rise of the Digital Telecommunication Marketplace.pptx
PriyaKumari928991
ย 
Cross-Cultural Leadership and Communication
Cross-Cultural Leadership and CommunicationCross-Cultural Leadership and Communication
Cross-Cultural Leadership and Communication
MattVassar1
ย 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
Kalna College
ย 
Information and Communication Technology in Education
Information and Communication Technology in EducationInformation and Communication Technology in Education
Information and Communication Technology in Education
MJDuyan
ย 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Kalna College
ย 
Interprofessional Education Platform Introduction.pdf
Interprofessional Education Platform Introduction.pdfInterprofessional Education Platform Introduction.pdf
Interprofessional Education Platform Introduction.pdf
Ben Aldrich
ย 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
Celine George
ย 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Quiz Club IIT Kanpur
ย 
pol sci Election and Representation Class 11 Notes.pdf
pol sci Election and Representation Class 11 Notes.pdfpol sci Election and Representation Class 11 Notes.pdf
pol sci Election and Representation Class 11 Notes.pdf
BiplabHalder13
ย 
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
yarusun
ย 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapitolTechU
ย 
Observational Learning
Observational Learning Observational Learning
Observational Learning
sanamushtaq922
ย 
Creativity for Innovation and Speechmaking
Creativity for Innovation and SpeechmakingCreativity for Innovation and Speechmaking
Creativity for Innovation and Speechmaking
MattVassar1
ย 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
Kalna College
ย 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
ShwetaGawande8
ย 
The Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teachingThe Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teaching
Derek Wenmoth
ย 
Slides Peluncuran Amalan Pemakanan Sihat.pptx
Slides Peluncuran Amalan Pemakanan Sihat.pptxSlides Peluncuran Amalan Pemakanan Sihat.pptx
Slides Peluncuran Amalan Pemakanan Sihat.pptx
shabeluno
ย 

Recently uploaded (20)

Erasmus + DISSEMINATION ACTIVITIES Croatia
Erasmus + DISSEMINATION ACTIVITIES CroatiaErasmus + DISSEMINATION ACTIVITIES Croatia
Erasmus + DISSEMINATION ACTIVITIES Croatia
ย 
IoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdfIoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdf
ย 
220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science
ย 
The Rise of the Digital Telecommunication Marketplace.pptx
The Rise of the Digital Telecommunication Marketplace.pptxThe Rise of the Digital Telecommunication Marketplace.pptx
The Rise of the Digital Telecommunication Marketplace.pptx
ย 
Cross-Cultural Leadership and Communication
Cross-Cultural Leadership and CommunicationCross-Cultural Leadership and Communication
Cross-Cultural Leadership and Communication
ย 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
ย 
Information and Communication Technology in Education
Information and Communication Technology in EducationInformation and Communication Technology in Education
Information and Communication Technology in Education
ย 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
ย 
Interprofessional Education Platform Introduction.pdf
Interprofessional Education Platform Introduction.pdfInterprofessional Education Platform Introduction.pdf
Interprofessional Education Platform Introduction.pdf
ย 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
ย 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
ย 
pol sci Election and Representation Class 11 Notes.pdf
pol sci Election and Representation Class 11 Notes.pdfpol sci Election and Representation Class 11 Notes.pdf
pol sci Election and Representation Class 11 Notes.pdf
ย 
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
ย 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
ย 
Observational Learning
Observational Learning Observational Learning
Observational Learning
ย 
Creativity for Innovation and Speechmaking
Creativity for Innovation and SpeechmakingCreativity for Innovation and Speechmaking
Creativity for Innovation and Speechmaking
ย 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
ย 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
ย 
The Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teachingThe Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teaching
ย 
Slides Peluncuran Amalan Pemakanan Sihat.pptx
Slides Peluncuran Amalan Pemakanan Sihat.pptxSlides Peluncuran Amalan Pemakanan Sihat.pptx
Slides Peluncuran Amalan Pemakanan Sihat.pptx
ย 

Threads ppt

  • 2. What is Threads..? ๏‚ด A thread is flow of execution through the process code, with its own program counter, system register & stack. ๏‚ด A thread is also called a light weight process. ๏‚ด Threads provide a way to improve application performance through parallelism. ๏‚ด Each thread belongs to exactly one process and no thread can exist outside a process.
  • 3.
  • 4. PROCESS. THREADS. Process is heavy weight. Threads is light weight. Process Switching needs interaction with operating system. Threads switching does not need to interact with operating system. If one process is blocked then no other process can execute until the first process is unblocked. While one threads is blocked and waiting, a second thread in the same task can run. Multiprocesses without using threads use more resource. One thread can read, write or change thread's data.
  • 5. ๏‚ด Advantages of Threads: 1. Provide better performance. 2. Allow any program to perform multiple task at once. ๏‚ด Disadvantages of Threads: 1. Blocking of parent threads will stop all child process.
  • 6. TYPES OF THREADS.. ๏‚ด Threads are implemented in following two ways: 1. User Level Threads. ( ULT ). 2. Kernel Level Threads. ( KLT ).
  • 7. User Level Threads. ( ULT ) ๏‚ด User level threads implement in user level libraries, so threads switching does not need to call operating system and to cause interrupt to the kernel. ๏‚ด In fact, the kernel knows nothing about user level threads and manages them as if they were single-threaded process.
  • 8. ๏‚ด Advantage of User level threads. 1. Easy to represent and manage. 2. User level thread can run on any operation system. 3. User level threads are fast and efficient. ๏‚ด Disadvantages: 1. There is a lack of coordination between threads and operating system kernel.
  • 9. Kernel Level Threads.. ๏‚ด In this method, the kernel knows about and manages the threads, No runtime system is needed in this case. ๏‚ด Operating system kernel provides system call to create and manages threads.
  • 10. ๏‚ด Advantages of Kernel level Threads: 1. Kernel can simultaneously schedule multiple threads from the same process on multiple process. 2. If one thread in a process is blocked the kernel can schedule another thread of same process. ๏‚ด Disadvantages: 1. Kernel threads are generally slower to create and manages than the user threads.
  • 11. USER LEVEL THREADS: KERNEL LEVEL THREADS: User level threads are faster to creates and manages. Kernel level threads are slower to creates and manage. Implementation is by a thread library at the user level. Operating system supports creation of kernel threads. User level threads is generic and can run any operating system. Kernel level threads is specific to the operating system. Multi threaded applications cannot take advantages of multiprocessing. Kernel routines themselves can be multithreaded.
  • 12. Multithreading Models: ๏‚ด The user threads must be mapped to kernel threads using on of the following strategies: 1. Many to One model. 2. One to One model. 3. Many to Many model.
  • 13. Many to One: ๏‚ด In many to one model many user level threads are mapped to one kernel threads. ๏‚ด Only one thread can access the kernel at a time, so it cannot run in parallel on Multiprocessor.
  • 14. One to One: ๏‚ด In one to one model, each user threads mapped to a kernel threads. ๏‚ด It provides more concurrency because it allows another thread to execute if a thread makes a blocking system calls. ๏‚ด Each user threads requires a kernel thread that may affect the performance of the system.
  • 15. Many to many: ๏‚ด This model multiplexes many user level threads to a smaller or equal numbers of kernel threads. ๏‚ด The kernel can execute another threads if a threads makes a blocking system call.
  ็ฟป่ฏ‘๏ผš