OS-CO2-Session 11 Multithreading Models
OS-CO2-Session 11 Multithreading Models
Multithreading Models
Dr. Elangovan G
Associate Professor
Department of Artificial Intelligence and Data Science
Koneru Lakshmaiah Education Foundation
(Deemed to be University)
Green fields, Vaddeswaram, AP-522502, India
Session : 11
Multithreading Models
• Multithreading Models
• Many-to-One
• One-to-One
• Many-to-Many
• Two-level Model
• Thread Libraries
• Pthreads
• Windows Multithreaded C Program
• Java Threads
8/24/2022 Operating Systems - CO2 2
User Threads and Kernel Threads
• User threads - management done by user-level threads library
• Three primary thread libraries:
• POSIX Pthreads
• Windows threads
• Java threads
• Kernel threads - Supported by the Kernel
• Examples – virtually all general-purpose operating systems, including:
– Windows
– Linux
– Mac OS X
– iOS
– Android
8/24/2022 Operating Systems - CO2 3
User and Kernel Threads
Creating a thread:
Waiting on a thread:
Answer: A
• 2. In the Many to One model, if a thread makes a blocking system call ___________
A. the entire process will be blocked
B. a part of the process will stay blocked, with the rest running
C. the entire process will run
D. none of the mentioned
Answer: A
Answer: B
• 4. Which of the following is the drawback of the One to One Model?
A. increased concurrency provided by this model
B. decreased concurrency provided by this model
C. creating so many threads at once can crash the system
D. creating a user thread requires creating the corresponding kernel thread
Answer: D