SlideShare uma empresa Scribd logo
1 de 16
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Thread Scheduler
And
Scheduler Activation
A Operating System
Implementing threads:
Kernel level threads:
Kernel level threads are supported and managed directly by the
operating system.
• The kernel knows about and manages all threads.
• One process control block (PCB) per process.
• Provide system calls to create and manage threads from user space.
A Operating System
User level threads:
User level threads are supported above the kernel in user space and are
managed with or sometimes out kernel support.
• Threads managed entirely by the run-time system (user-level
library).
• Ideally, thread operations should be as fast as a function call.
• The kernel knows little about user-level threads and manage them
as if they where single-threaded processes.
User-level thread models:
In general, user-level threads can be implemented using one of four
models: Many-to-one, One-to-one
A Operating System
User-level thread models:
In general, user-level threads can be implemented using one of four
models: Many-to-many, Two-level
A Operating System
• In Many-to-Many model and Two-level model there must be some way
for the kernel to communicate with the user level thread manager to
maintain an appropriate number of kernel threads execution.
• This mechanism is called scheduler activations just like Context
Switching activation
• The kernel provides the application with a set of kernel threads (virtual
processors) with resources; memory, cache memory, files etc
• The application and the OS have complete control over which threads to
run on each of the kernel threads
• What I/O operations are being performed under that application
Scheduler activations:
A Operating System
• The number of kernel threads (virtual processors) in the set is
controlled by the kernel, in response to the competing demands of
different processes in the system
• The kernel notify the user-level thread manager of important kernel
events using upcalls from the kernel to the user-level thread manager.
• Examples of such events includes a thread making a blocking system
call and the kernel allocating a new kernel thread to the process
Scheduler activations:
Operating System
Scheduler activations:
Operating System
Example
Let’s study an example of how
scheduler activations can be used.
The kernel has allocated one kernel
thread (1) to a process with three
user-level threads (2).
The three user level threads take turn
executing on the single kernel-level
thread for their execution
They will share data/code if required
The executing thread makes a blocking system call (3) and the kernel
blocks the calling user-level thread and the kernel-level thread used to
execute the user-level thread (4).
• Scheduler activation: the kernel
decides to allocate a new kernel-level
thread to the process (5).
• Upcall: the kernel notifies the user-
level thread manager which user-level
thread that is now blocked and that a
new kernel-level thread is available (6).
• The user-level thread manager move
the other threads to the new kernel
thread and resumes one of the ready
threads (7).
Scheduler activations:
A Operating System
While one user-level thread is blocked (8) the other threads can take turn
executing on the new kernel thread (9).
Scheduler activations:
A Operating System
• When a part of the process (the thread) which got blocked due to
i/o) gets blocked for i/o operation, the os suspends the entire
process, since the os deals only with the processes
• As in the many to one model, there is only a single kernel, the
process whose thread was blocked cant be executed until the
blocked thread resumes,
• whereas in a many to many or one to one model, each kernel runs
its piece of code and is unaware of the threads blocked in the other
kernels.
Scheduler activations:
A Operating System
Cooperative scheduling of user-level threads
The cooperative model is similar to multiprogramming where a process
executes on the CPU until making a I/O request.
Cooperative user-level threads execute on the assigned kernel-level
thread until they voluntarily give back the kernel thread to the thread
manager.
Scheduler activations:
A Operating System
In the cooperative model, threads yield to each other, either explicitly
(e.g., by calling a yield() provided by the user-level thread library)
Or
implicitly (e.g., requesting a lock held by another thread). In the below
figure a many-to-one system with cooperative user-level threads is
shown.
Scheduler activations:
A Operating System
Preemptive scheduling of user-level threads
The preemptive model is similar to multitasking (like time sharing).
Multitasking is a logical extension of multiprogramming where a timer is
set to cause an interrupt at a regular time interval
The running process is replaced if the job requests I/O or if the job is
interrupted by the timer.
Scheduler activations:
A Operating System
In the preemptive model, a timer is used to cause execution flow to jump
to a central dispatcher thread, which chooses the next thread to run.
In the below figure a many-to-one system with preemptive user-level
threads is shown.
Scheduler activations:
A Operating System
(Hybrid Method) Cooperative and preemptive (hybrid) scheduling of
user-level threads
A hybrid model between cooperative and preemptive scheduling is also
possible where a running thread may yield() or preempted by a timer.
Scheduler activations:
A Operating System

Mais conteúdo relacionado

Semelhante a OS Thr schd.ppt

process and thread.pptx
process and thread.pptxprocess and thread.pptx
process and thread.pptxHamzaxTv
 
Multithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdfMultithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdfHarika Pudugosula
 
1 Multithreading basics.pptx
1 Multithreading basics.pptx1 Multithreading basics.pptx
1 Multithreading basics.pptxYojanaFegade
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)Prakhar Maurya
 
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
 
Concept of thread, multi thread, tcb
Concept of thread, multi thread, tcbConcept of thread, multi thread, tcb
Concept of thread, multi thread, tcbKanza batool
 
threads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptxthreads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptxpiyushlohia1857
 
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
 

Semelhante a OS Thr schd.ppt (20)

Threads .ppt
Threads .pptThreads .ppt
Threads .ppt
 
Threading.pptx
Threading.pptxThreading.pptx
Threading.pptx
 
process and thread.pptx
process and thread.pptxprocess and thread.pptx
process and thread.pptx
 
Multithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdfMultithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdf
 
Thread
ThreadThread
Thread
 
Thread
ThreadThread
Thread
 
Threads.ppt
Threads.pptThreads.ppt
Threads.ppt
 
1 Multithreading basics.pptx
1 Multithreading basics.pptx1 Multithreading basics.pptx
1 Multithreading basics.pptx
 
thread os.pptx
thread os.pptxthread os.pptx
thread os.pptx
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
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
 
Thread
ThreadThread
Thread
 
Sucet os module_2_notes
Sucet os module_2_notesSucet os module_2_notes
Sucet os module_2_notes
 
Topic 4- processes.pptx
Topic 4- processes.pptxTopic 4- processes.pptx
Topic 4- processes.pptx
 
Concept of thread, multi thread, tcb
Concept of thread, multi thread, tcbConcept of thread, multi thread, tcb
Concept of thread, multi thread, tcb
 
threads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptxthreads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptx
 
4.Process.ppt
4.Process.ppt4.Process.ppt
4.Process.ppt
 
Lect06
Lect06Lect06
Lect06
 
Operating Systems - "Chapter 4: Multithreaded Programming"
Operating Systems - "Chapter 4:  Multithreaded Programming"Operating Systems - "Chapter 4:  Multithreaded Programming"
Operating Systems - "Chapter 4: Multithreaded Programming"
 

Mais de ZohairMughal1

HCI Lecture # 2 (2).pptx
HCI Lecture # 2 (2).pptxHCI Lecture # 2 (2).pptx
HCI Lecture # 2 (2).pptxZohairMughal1
 
Lecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).pptLecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).pptZohairMughal1
 
SE 09 (test design techs).pptx
SE 09 (test design techs).pptxSE 09 (test design techs).pptx
SE 09 (test design techs).pptxZohairMughal1
 
Lecture # 8 (HCI).pptx
Lecture # 8 (HCI).pptxLecture # 8 (HCI).pptx
Lecture # 8 (HCI).pptxZohairMughal1
 
Lecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.pptLecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.pptZohairMughal1
 
Khilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdf
Khilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdfKhilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdf
Khilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdfZohairMughal1
 

Mais de ZohairMughal1 (6)

HCI Lecture # 2 (2).pptx
HCI Lecture # 2 (2).pptxHCI Lecture # 2 (2).pptx
HCI Lecture # 2 (2).pptx
 
Lecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).pptLecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).ppt
 
SE 09 (test design techs).pptx
SE 09 (test design techs).pptxSE 09 (test design techs).pptx
SE 09 (test design techs).pptx
 
Lecture # 8 (HCI).pptx
Lecture # 8 (HCI).pptxLecture # 8 (HCI).pptx
Lecture # 8 (HCI).pptx
 
Lecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.pptLecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.ppt
 
Khilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdf
Khilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdfKhilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdf
Khilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdf
 

Último

Prepare And Cook Meat.pptx Quarter II Module
Prepare And Cook Meat.pptx Quarter II ModulePrepare And Cook Meat.pptx Quarter II Module
Prepare And Cook Meat.pptx Quarter II Modulemaricel769799
 
(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一
(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一
(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一Fi sss
 
526350093-Online-Food-Ordering-System-Ppt.pptx
526350093-Online-Food-Ordering-System-Ppt.pptx526350093-Online-Food-Ordering-System-Ppt.pptx
526350093-Online-Food-Ordering-System-Ppt.pptxJaidBagwan2
 
HIGH PRESSURE PROCESSING ( HPP ) .pptx
HIGH PRESSURE  PROCESSING ( HPP )  .pptxHIGH PRESSURE  PROCESSING ( HPP )  .pptx
HIGH PRESSURE PROCESSING ( HPP ) .pptxparvin6647
 
thanksgiving dinner and more information
thanksgiving dinner and more informationthanksgiving dinner and more information
thanksgiving dinner and more informationlialiaskou00
 
pitch presentation B2.pptx Sunderland Culture
pitch presentation B2.pptx Sunderland Culturepitch presentation B2.pptx Sunderland Culture
pitch presentation B2.pptx Sunderland CultureChloeMeadows1
 
FONDANT ICING bread and pastry prod.pptx
FONDANT ICING bread and pastry prod.pptxFONDANT ICING bread and pastry prod.pptx
FONDANT ICING bread and pastry prod.pptxReleneJoySoto
 
Food-Allergy-PowerPoint-Presentation-2.ppt
Food-Allergy-PowerPoint-Presentation-2.pptFood-Allergy-PowerPoint-Presentation-2.ppt
Food-Allergy-PowerPoint-Presentation-2.pptIsaacMensah62
 
Aquaculture Market Trends, Top Manufactures, Industry Growth Analysis and For...
Aquaculture Market Trends, Top Manufactures, Industry Growth Analysis and For...Aquaculture Market Trends, Top Manufactures, Industry Growth Analysis and For...
Aquaculture Market Trends, Top Manufactures, Industry Growth Analysis and For...Next Move Strategy Consulting
 
FUTURISTIC FOOD PRODUCTS OFTEN INVOLVE INNOVATIONS THAT
FUTURISTIC FOOD PRODUCTS OFTEN INVOLVE INNOVATIONS THATFUTURISTIC FOOD PRODUCTS OFTEN INVOLVE INNOVATIONS THAT
FUTURISTIC FOOD PRODUCTS OFTEN INVOLVE INNOVATIONS THATBHIKHUKUMAR KUNWARADIYA
 
Estimation of protein quality using various methods
Estimation of protein quality using various methodsEstimation of protein quality using various methods
Estimation of protein quality using various methodsThiviKutty
 
Gwal Pahari Call Girls 9873940964 Book Hot And Sexy Girls
Gwal Pahari Call Girls 9873940964 Book Hot And Sexy GirlsGwal Pahari Call Girls 9873940964 Book Hot And Sexy Girls
Gwal Pahari Call Girls 9873940964 Book Hot And Sexy Girlshram8477
 
Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...
Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...
Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...dollysharma2066
 
ACCEPTABILITY-OF-AMPALAYA-BITTER-GOURD.pptx
ACCEPTABILITY-OF-AMPALAYA-BITTER-GOURD.pptxACCEPTABILITY-OF-AMPALAYA-BITTER-GOURD.pptx
ACCEPTABILITY-OF-AMPALAYA-BITTER-GOURD.pptxBELARMINOJOLINA
 
如何办韩国SKKU文凭,成均馆大学毕业证学位证怎么辨别?
如何办韩国SKKU文凭,成均馆大学毕业证学位证怎么辨别?如何办韩国SKKU文凭,成均馆大学毕业证学位证怎么辨别?
如何办韩国SKKU文凭,成均馆大学毕业证学位证怎么辨别?t6tjlrih
 
Irradiation preservation of food advancements
Irradiation preservation of food advancementsIrradiation preservation of food advancements
Irradiation preservation of food advancementsDeepika Sugumar
 
Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012
Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012
Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012rehmti665
 
韩国学位证,全北大学毕业证书1:1制作
韩国学位证,全北大学毕业证书1:1制作韩国学位证,全北大学毕业证书1:1制作
韩国学位证,全北大学毕业证书1:1制作7tz4rjpd
 

Último (20)

Prepare And Cook Meat.pptx Quarter II Module
Prepare And Cook Meat.pptx Quarter II ModulePrepare And Cook Meat.pptx Quarter II Module
Prepare And Cook Meat.pptx Quarter II Module
 
(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一
(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一
(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一
 
526350093-Online-Food-Ordering-System-Ppt.pptx
526350093-Online-Food-Ordering-System-Ppt.pptx526350093-Online-Food-Ordering-System-Ppt.pptx
526350093-Online-Food-Ordering-System-Ppt.pptx
 
Call Girls in Hauz Khas⎝⎝9953056974⎝⎝ Delhi NCR
Call Girls in Hauz Khas⎝⎝9953056974⎝⎝ Delhi NCRCall Girls in Hauz Khas⎝⎝9953056974⎝⎝ Delhi NCR
Call Girls in Hauz Khas⎝⎝9953056974⎝⎝ Delhi NCR
 
HIGH PRESSURE PROCESSING ( HPP ) .pptx
HIGH PRESSURE  PROCESSING ( HPP )  .pptxHIGH PRESSURE  PROCESSING ( HPP )  .pptx
HIGH PRESSURE PROCESSING ( HPP ) .pptx
 
thanksgiving dinner and more information
thanksgiving dinner and more informationthanksgiving dinner and more information
thanksgiving dinner and more information
 
pitch presentation B2.pptx Sunderland Culture
pitch presentation B2.pptx Sunderland Culturepitch presentation B2.pptx Sunderland Culture
pitch presentation B2.pptx Sunderland Culture
 
FONDANT ICING bread and pastry prod.pptx
FONDANT ICING bread and pastry prod.pptxFONDANT ICING bread and pastry prod.pptx
FONDANT ICING bread and pastry prod.pptx
 
Food-Allergy-PowerPoint-Presentation-2.ppt
Food-Allergy-PowerPoint-Presentation-2.pptFood-Allergy-PowerPoint-Presentation-2.ppt
Food-Allergy-PowerPoint-Presentation-2.ppt
 
Aquaculture Market Trends, Top Manufactures, Industry Growth Analysis and For...
Aquaculture Market Trends, Top Manufactures, Industry Growth Analysis and For...Aquaculture Market Trends, Top Manufactures, Industry Growth Analysis and For...
Aquaculture Market Trends, Top Manufactures, Industry Growth Analysis and For...
 
FUTURISTIC FOOD PRODUCTS OFTEN INVOLVE INNOVATIONS THAT
FUTURISTIC FOOD PRODUCTS OFTEN INVOLVE INNOVATIONS THATFUTURISTIC FOOD PRODUCTS OFTEN INVOLVE INNOVATIONS THAT
FUTURISTIC FOOD PRODUCTS OFTEN INVOLVE INNOVATIONS THAT
 
9953330565 Low Rate Call Girls In Sameypur-Bodli Delhi NCR
9953330565 Low Rate Call Girls In Sameypur-Bodli Delhi NCR9953330565 Low Rate Call Girls In Sameypur-Bodli Delhi NCR
9953330565 Low Rate Call Girls In Sameypur-Bodli Delhi NCR
 
Estimation of protein quality using various methods
Estimation of protein quality using various methodsEstimation of protein quality using various methods
Estimation of protein quality using various methods
 
Gwal Pahari Call Girls 9873940964 Book Hot And Sexy Girls
Gwal Pahari Call Girls 9873940964 Book Hot And Sexy GirlsGwal Pahari Call Girls 9873940964 Book Hot And Sexy Girls
Gwal Pahari Call Girls 9873940964 Book Hot And Sexy Girls
 
Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...
Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...
Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...
 
ACCEPTABILITY-OF-AMPALAYA-BITTER-GOURD.pptx
ACCEPTABILITY-OF-AMPALAYA-BITTER-GOURD.pptxACCEPTABILITY-OF-AMPALAYA-BITTER-GOURD.pptx
ACCEPTABILITY-OF-AMPALAYA-BITTER-GOURD.pptx
 
如何办韩国SKKU文凭,成均馆大学毕业证学位证怎么辨别?
如何办韩国SKKU文凭,成均馆大学毕业证学位证怎么辨别?如何办韩国SKKU文凭,成均馆大学毕业证学位证怎么辨别?
如何办韩国SKKU文凭,成均馆大学毕业证学位证怎么辨别?
 
Irradiation preservation of food advancements
Irradiation preservation of food advancementsIrradiation preservation of food advancements
Irradiation preservation of food advancements
 
Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012
Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012
Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012
 
韩国学位证,全北大学毕业证书1:1制作
韩国学位证,全北大学毕业证书1:1制作韩国学位证,全北大学毕业证书1:1制作
韩国学位证,全北大学毕业证书1:1制作
 

OS Thr schd.ppt

  • 1. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Thread Scheduler And Scheduler Activation
  • 3. Kernel level threads: Kernel level threads are supported and managed directly by the operating system. • The kernel knows about and manages all threads. • One process control block (PCB) per process. • Provide system calls to create and manage threads from user space. A Operating System User level threads: User level threads are supported above the kernel in user space and are managed with or sometimes out kernel support. • Threads managed entirely by the run-time system (user-level library). • Ideally, thread operations should be as fast as a function call. • The kernel knows little about user-level threads and manage them as if they where single-threaded processes.
  • 4. User-level thread models: In general, user-level threads can be implemented using one of four models: Many-to-one, One-to-one A Operating System
  • 5. User-level thread models: In general, user-level threads can be implemented using one of four models: Many-to-many, Two-level A Operating System
  • 6. • In Many-to-Many model and Two-level model there must be some way for the kernel to communicate with the user level thread manager to maintain an appropriate number of kernel threads execution. • This mechanism is called scheduler activations just like Context Switching activation • The kernel provides the application with a set of kernel threads (virtual processors) with resources; memory, cache memory, files etc • The application and the OS have complete control over which threads to run on each of the kernel threads • What I/O operations are being performed under that application Scheduler activations: A Operating System
  • 7. • The number of kernel threads (virtual processors) in the set is controlled by the kernel, in response to the competing demands of different processes in the system • The kernel notify the user-level thread manager of important kernel events using upcalls from the kernel to the user-level thread manager. • Examples of such events includes a thread making a blocking system call and the kernel allocating a new kernel thread to the process Scheduler activations: Operating System
  • 8. Scheduler activations: Operating System Example Let’s study an example of how scheduler activations can be used. The kernel has allocated one kernel thread (1) to a process with three user-level threads (2). The three user level threads take turn executing on the single kernel-level thread for their execution They will share data/code if required
  • 9. The executing thread makes a blocking system call (3) and the kernel blocks the calling user-level thread and the kernel-level thread used to execute the user-level thread (4). • Scheduler activation: the kernel decides to allocate a new kernel-level thread to the process (5). • Upcall: the kernel notifies the user- level thread manager which user-level thread that is now blocked and that a new kernel-level thread is available (6). • The user-level thread manager move the other threads to the new kernel thread and resumes one of the ready threads (7). Scheduler activations: A Operating System
  • 10. While one user-level thread is blocked (8) the other threads can take turn executing on the new kernel thread (9). Scheduler activations: A Operating System
  • 11. • When a part of the process (the thread) which got blocked due to i/o) gets blocked for i/o operation, the os suspends the entire process, since the os deals only with the processes • As in the many to one model, there is only a single kernel, the process whose thread was blocked cant be executed until the blocked thread resumes, • whereas in a many to many or one to one model, each kernel runs its piece of code and is unaware of the threads blocked in the other kernels. Scheduler activations: A Operating System
  • 12. Cooperative scheduling of user-level threads The cooperative model is similar to multiprogramming where a process executes on the CPU until making a I/O request. Cooperative user-level threads execute on the assigned kernel-level thread until they voluntarily give back the kernel thread to the thread manager. Scheduler activations: A Operating System
  • 13. In the cooperative model, threads yield to each other, either explicitly (e.g., by calling a yield() provided by the user-level thread library) Or implicitly (e.g., requesting a lock held by another thread). In the below figure a many-to-one system with cooperative user-level threads is shown. Scheduler activations: A Operating System
  • 14. Preemptive scheduling of user-level threads The preemptive model is similar to multitasking (like time sharing). Multitasking is a logical extension of multiprogramming where a timer is set to cause an interrupt at a regular time interval The running process is replaced if the job requests I/O or if the job is interrupted by the timer. Scheduler activations: A Operating System
  • 15. In the preemptive model, a timer is used to cause execution flow to jump to a central dispatcher thread, which chooses the next thread to run. In the below figure a many-to-one system with preemptive user-level threads is shown. Scheduler activations: A Operating System
  • 16. (Hybrid Method) Cooperative and preemptive (hybrid) scheduling of user-level threads A hybrid model between cooperative and preemptive scheduling is also possible where a running thread may yield() or preempted by a timer. Scheduler activations: A Operating System