SlideShare a Scribd company logo
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

More Related Content

Similar to OS Thr schd.ppt

Threads .ppt
Threads .pptThreads .ppt
Threads .ppt
meet darji
 
Threading.pptx
Threading.pptxThreading.pptx
Threading.pptx
BalasundaramSr
 
process and thread.pptx
process and thread.pptxprocess and thread.pptx
process and thread.pptx
HamzaxTv
 
Multithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdfMultithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdf
Harika Pudugosula
 
Thread
ThreadThread
Thread
sajidhuseyin
 
Thread
ThreadThread
Threads.ppt
Threads.pptThreads.ppt
Threads.ppt
amadayshwan
 
1 Multithreading basics.pptx
1 Multithreading basics.pptx1 Multithreading basics.pptx
1 Multithreading basics.pptx
YojanaFegade
 
Multithreaded Programming in oprating system
Multithreaded Programming in oprating  systemMultithreaded Programming in oprating  system
Multithreaded Programming in oprating system
YOGENDRAMS
 
thread os.pptx
thread os.pptxthread os.pptx
thread os.pptx
SANJUSANJEEVTOPPO
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
Kumbirai Junior Muzavazi
 
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
 
Thread
ThreadThread
Sucet os module_2_notes
Sucet os module_2_notesSucet os module_2_notes
Sucet os module_2_notes
SRINIVASUNIVERSITYEN
 
Topic 4- processes.pptx
Topic 4- processes.pptxTopic 4- processes.pptx
Topic 4- processes.pptx
DanishMahmood23
 
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
 
threads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptxthreads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptx
piyushlohia1857
 
4.Process.ppt
4.Process.ppt4.Process.ppt
4.Process.ppt
AkfeteAssefa
 
Lect06
Lect06Lect06
Lect06
Vin Voro
 

Similar to 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
 
Multithreaded Programming in oprating system
Multithreaded Programming in oprating  systemMultithreaded Programming in oprating  system
Multithreaded Programming in oprating system
 
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
 

More from ZohairMughal1

HCI Lecture # 2 (2).pptx
HCI Lecture # 2 (2).pptxHCI Lecture # 2 (2).pptx
HCI Lecture # 2 (2).pptx
ZohairMughal1
 
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
ZohairMughal1
 
SE 09 (test design techs).pptx
SE 09 (test design techs).pptxSE 09 (test design techs).pptx
SE 09 (test design techs).pptx
ZohairMughal1
 
Lecture # 8 (HCI).pptx
Lecture # 8 (HCI).pptxLecture # 8 (HCI).pptx
Lecture # 8 (HCI).pptx
ZohairMughal1
 
Lecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.pptLecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.ppt
ZohairMughal1
 
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
ZohairMughal1
 

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

Recently uploaded

Science Text Book characteristics and library
Science Text Book characteristics and libraryScience Text Book characteristics and library
Science Text Book characteristics and library
Jerslin Muller
 
一比一原版美国俄克拉荷马大学毕业证(ou学位证)如何办理
一比一原版美国俄克拉荷马大学毕业证(ou学位证)如何办理一比一原版美国俄克拉荷马大学毕业证(ou学位证)如何办理
一比一原版美国俄克拉荷马大学毕业证(ou学位证)如何办理
p74xokfq
 
一比一原版(Bristol毕业证)布里斯托大学毕业证如何办理
一比一原版(Bristol毕业证)布里斯托大学毕业证如何办理一比一原版(Bristol毕业证)布里斯托大学毕业证如何办理
一比一原版(Bristol毕业证)布里斯托大学毕业证如何办理
uhyqho
 
A Review on Recent Advances of Packaging in Food Industry
A Review on Recent Advances of Packaging in Food IndustryA Review on Recent Advances of Packaging in Food Industry
A Review on Recent Advances of Packaging in Food Industry
PriyankaKilaniya
 
一比一原版美国宾夕法尼亚州立大学毕业证(penstate学位证)如何办理
一比一原版美国宾夕法尼亚州立大学毕业证(penstate学位证)如何办理一比一原版美国宾夕法尼亚州立大学毕业证(penstate学位证)如何办理
一比一原版美国宾夕法尼亚州立大学毕业证(penstate学位证)如何办理
p74xokfq
 
Discover the Magic 7 Fruits for Weight Loss You Need to Know About!.pdf
Discover the Magic 7 Fruits for Weight Loss You Need to Know About!.pdfDiscover the Magic 7 Fruits for Weight Loss You Need to Know About!.pdf
Discover the Magic 7 Fruits for Weight Loss You Need to Know About!.pdf
RapidLeaks
 
一比一原版美国俄克拉荷马城市大学毕业证(ocu学位证)如何办理
一比一原版美国俄克拉荷马城市大学毕业证(ocu学位证)如何办理一比一原版美国俄克拉荷马城市大学毕业证(ocu学位证)如何办理
一比一原版美国俄克拉荷马城市大学毕业证(ocu学位证)如何办理
p74xokfq
 
FOOD PSYCHOLOGY CHARLA EN INGLES SOBRE PSICOLOGIA NUTRICIONAL
FOOD PSYCHOLOGY CHARLA EN INGLES SOBRE PSICOLOGIA NUTRICIONALFOOD PSYCHOLOGY CHARLA EN INGLES SOBRE PSICOLOGIA NUTRICIONAL
FOOD PSYCHOLOGY CHARLA EN INGLES SOBRE PSICOLOGIA NUTRICIONAL
NataliaLedezma6
 
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
vdabso
 
Top 12 Best Restaurants in Panchkula city
Top 12 Best Restaurants in Panchkula cityTop 12 Best Restaurants in Panchkula city
Top 12 Best Restaurants in Panchkula city
Tricity help post
 
Agriculture Market : Global Trends and Forecast Analysis (2023-2032)
Agriculture Market : Global Trends and Forecast Analysis (2023-2032)Agriculture Market : Global Trends and Forecast Analysis (2023-2032)
Agriculture Market : Global Trends and Forecast Analysis (2023-2032)
PriyanshiSingh187645
 
Food smoking- processing & preservation.pptx
Food smoking- processing & preservation.pptxFood smoking- processing & preservation.pptx
Food smoking- processing & preservation.pptx
KalyaniThoteLondhe
 
Cacao, the main component used in the creation of chocolate and other cacao-b...
Cacao, the main component used in the creation of chocolate and other cacao-b...Cacao, the main component used in the creation of chocolate and other cacao-b...
Cacao, the main component used in the creation of chocolate and other cacao-b...
AdelinePdelaCruz
 
What is a typical meal for a person on a Mediterranean diet?
What is a typical meal for a person on a Mediterranean diet?What is a typical meal for a person on a Mediterranean diet?
What is a typical meal for a person on a Mediterranean diet?
Krill Arctic Foods
 
Exploring_Karnali_Region_of_Nepal_(Food, Culture and People).pptx
Exploring_Karnali_Region_of_Nepal_(Food, Culture and People).pptxExploring_Karnali_Region_of_Nepal_(Food, Culture and People).pptx
Exploring_Karnali_Region_of_Nepal_(Food, Culture and People).pptx
Lincoln University
 
Coffee Presentation Coffee in the CordillerasPDF.pdf
Coffee Presentation Coffee in the CordillerasPDF.pdfCoffee Presentation Coffee in the CordillerasPDF.pdf
Coffee Presentation Coffee in the CordillerasPDF.pdf
ronnelapilado23
 

Recently uploaded (16)

Science Text Book characteristics and library
Science Text Book characteristics and libraryScience Text Book characteristics and library
Science Text Book characteristics and library
 
一比一原版美国俄克拉荷马大学毕业证(ou学位证)如何办理
一比一原版美国俄克拉荷马大学毕业证(ou学位证)如何办理一比一原版美国俄克拉荷马大学毕业证(ou学位证)如何办理
一比一原版美国俄克拉荷马大学毕业证(ou学位证)如何办理
 
一比一原版(Bristol毕业证)布里斯托大学毕业证如何办理
一比一原版(Bristol毕业证)布里斯托大学毕业证如何办理一比一原版(Bristol毕业证)布里斯托大学毕业证如何办理
一比一原版(Bristol毕业证)布里斯托大学毕业证如何办理
 
A Review on Recent Advances of Packaging in Food Industry
A Review on Recent Advances of Packaging in Food IndustryA Review on Recent Advances of Packaging in Food Industry
A Review on Recent Advances of Packaging in Food Industry
 
一比一原版美国宾夕法尼亚州立大学毕业证(penstate学位证)如何办理
一比一原版美国宾夕法尼亚州立大学毕业证(penstate学位证)如何办理一比一原版美国宾夕法尼亚州立大学毕业证(penstate学位证)如何办理
一比一原版美国宾夕法尼亚州立大学毕业证(penstate学位证)如何办理
 
Discover the Magic 7 Fruits for Weight Loss You Need to Know About!.pdf
Discover the Magic 7 Fruits for Weight Loss You Need to Know About!.pdfDiscover the Magic 7 Fruits for Weight Loss You Need to Know About!.pdf
Discover the Magic 7 Fruits for Weight Loss You Need to Know About!.pdf
 
一比一原版美国俄克拉荷马城市大学毕业证(ocu学位证)如何办理
一比一原版美国俄克拉荷马城市大学毕业证(ocu学位证)如何办理一比一原版美国俄克拉荷马城市大学毕业证(ocu学位证)如何办理
一比一原版美国俄克拉荷马城市大学毕业证(ocu学位证)如何办理
 
FOOD PSYCHOLOGY CHARLA EN INGLES SOBRE PSICOLOGIA NUTRICIONAL
FOOD PSYCHOLOGY CHARLA EN INGLES SOBRE PSICOLOGIA NUTRICIONALFOOD PSYCHOLOGY CHARLA EN INGLES SOBRE PSICOLOGIA NUTRICIONAL
FOOD PSYCHOLOGY CHARLA EN INGLES SOBRE PSICOLOGIA NUTRICIONAL
 
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
 
Top 12 Best Restaurants in Panchkula city
Top 12 Best Restaurants in Panchkula cityTop 12 Best Restaurants in Panchkula city
Top 12 Best Restaurants in Panchkula city
 
Agriculture Market : Global Trends and Forecast Analysis (2023-2032)
Agriculture Market : Global Trends and Forecast Analysis (2023-2032)Agriculture Market : Global Trends and Forecast Analysis (2023-2032)
Agriculture Market : Global Trends and Forecast Analysis (2023-2032)
 
Food smoking- processing & preservation.pptx
Food smoking- processing & preservation.pptxFood smoking- processing & preservation.pptx
Food smoking- processing & preservation.pptx
 
Cacao, the main component used in the creation of chocolate and other cacao-b...
Cacao, the main component used in the creation of chocolate and other cacao-b...Cacao, the main component used in the creation of chocolate and other cacao-b...
Cacao, the main component used in the creation of chocolate and other cacao-b...
 
What is a typical meal for a person on a Mediterranean diet?
What is a typical meal for a person on a Mediterranean diet?What is a typical meal for a person on a Mediterranean diet?
What is a typical meal for a person on a Mediterranean diet?
 
Exploring_Karnali_Region_of_Nepal_(Food, Culture and People).pptx
Exploring_Karnali_Region_of_Nepal_(Food, Culture and People).pptxExploring_Karnali_Region_of_Nepal_(Food, Culture and People).pptx
Exploring_Karnali_Region_of_Nepal_(Food, Culture and People).pptx
 
Coffee Presentation Coffee in the CordillerasPDF.pdf
Coffee Presentation Coffee in the CordillerasPDF.pdfCoffee Presentation Coffee in the CordillerasPDF.pdf
Coffee Presentation Coffee in the CordillerasPDF.pdf
 

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