Scheduling (computing): Difference between revisions

Content deleted Content added
https://superuser.com/a/841325
Tags: Reverted Visual edit Mobile edit Mobile web edit
SSKS1 (talk | contribs)
m Types of operating system schedulers: Corrected Signal Redirect
Tags: Mobile edit Mobile app edit Android app edit App section source
 
(9 intermediate revisions by 5 users not shown)
Line 112:
 
===={{Anchor|SHORT-TERM}}Short-term scheduling====
The ''short-term scheduler'' (also known as the ''CPU scheduler'') decides which of the ready, in-memory processes is to be executed (allocated a CPU) after a clock [[interrupt]], an I/O interrupt, an operating [[system call]] or another form of [[Signal programming(IPC)|signal]]. Thus the short-term scheduler makes scheduling decisions much more frequently than the long-term or mid-term schedulers{{snd}} A scheduling decision will at a minimum have to be made after every time slice, and these are very short. This scheduler can be [[Preemption (computing)|preemptive]], implying that it is capable of forcibly removing processes from a CPU when it decides to allocate that CPU to another process, or non-preemptive (also known as ''voluntary'' or ''co-operative''), in which case the scheduler is unable to ''force'' processes off the CPU.
 
A preemptive scheduler relies upon a [[programmable interval timer]] which invokes an [[interrupt handler]] that runs in [[kernel mode]] and implements the scheduling function.
Line 238:
Very early [[MS-DOS]] and Microsoft Windows systems were non-multitasking, and as such did not feature a scheduler. [[Windows 3.1x]] used a non-preemptive scheduler, meaning that it did not interrupt programs. It relied on the program to end or tell the OS that it didn't need the processor so that it could move on to another process. This is usually called cooperative multitasking. Windows 95 introduced a rudimentary preemptive scheduler; however, for legacy support opted to let 16-bit applications run without preemption.<ref>{{webarchive |url=https://web.archive.org/web/*/www.jgcampbell.com/caos/html/node13.html |date=* |title=Early Windows }}</ref>
 
[[Windows NT]]-based operating systems use a multilevel feedback queue. 32 priority levels are defined, 0 through to 31, with priorities 0 through 15 being ''normal'' priorities and priorities 16 through 31 being soft real-time priorities, requiring privileges to assign. 0 is reserved for the Operating System. User interfaces and APIs work with priority classes for the process and the threads in the process, which are then combined by the system into the absolute priority level.
 
The kernel may change the priority level of a thread depending on its I/O and CPU usage and whether it is interactive (i.e. accepts and responds to input from humans), raising the priority of interactive and I/O bounded processes and lowering that of CPU bound processes, to increase the responsiveness of interactive applications.<ref>{{cite web|title=A Tale of Two Schedulers Windows NT and Windows CE |url=http://sriramk.com/schedulers.html |author=Sriram Krishnan |url-status=dead |archive-url=https://web.archive.org/web/20120722015555/http://sriramk.com/schedulers.html |archive-date=July 22, 2012 }}</ref> The scheduler was modified in [[Windows Vista]] to use the [[Time Stamp Counter|cycle counter register]] of modern processors to keep track of exactly how many CPU cycles a thread has executed, rather than just using an interval-timer interrupt routine.<ref>{{cite web|url=https://technet.microsoft.com/en-us/magazine/cc162494.aspx |title=Windows Administration: Inside the Windows Vista Kernel: Part 1 |website=Technet.microsoft.com |date=2016-11-14 |access-date=2016-12-09}}</ref> Vista also uses a priority scheduler for the I/O queue so that disk defragmenters and other such programs do not interfere with foreground operations.<ref>{{cite web |url=http://blog.gabefrost.com/?p=25 |title=Archived copy |website=blog.gabefrost.com |access-date=15 January 2022 |archive-url=https://web.archive.org/web/20080219174631/http://blog.gabefrost.com/?p=25 |archive-date=19 February 2008 |url-status=dead}}</ref>
Line 298:
 
===NetBSD===
[[NetBSD]] uses a multilevel feedback queue with priorities ranging from 0–223. 0–63 are reserved for time-shared threads (default, SCHED_OTHER policy), 64–95 for user threads which entered [[kernel space]], 96-12896–128 for kernel threads, 128–191 for user real-time threads (SCHED_FIFO and SCHED_RR policies), and 192–223 for [[Interrupt|software interrupts]].
 
===Solaris===
Line 364:
| [[Windows NT]] (including 2000, XP, Vista, 7, and Server)
| {{Yes}}
| [[Multilevel feedback queue|Multilevel queue]]
|}