Monday, June 3, 2019

Compare cpu scheduling of linux and windows

Compargon cpu programming of linux and windowsACKNOWLEGMENTI mohd sharique ansari of B tech-M Tech (CSE) would standardized to thank my teacher of numerical analysis Mr. RK Gupta who helped me throughout the development of this paper in best possible way. I would like appreciate the dedication and distressfulness of my teacher for his guidance without whom this paper would non been possible.At last I would like to thank all my friends for their support.INTRODUCTIONCPU SCHEDULINGScheduling basically deals with the selection of a process that exists in the memory and ready to execute. The selected process is allocated with the CPU. This function is performed by the CPU scheduler. The CPU scheduler makes a sequence of moves that determines the interleaving of lifts. Programs use synchrony to prevent bad moves. but otherwise scheduling choices appear (to the program) to be nondeterministic.The schedulers moves are dictated by a scheduling policy.A general overview of the schedulin g is depicted by the below representation Windows process scheduling1) Windows 3.1 xs 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 didnt need 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 bequest support opted to let 16 bit applications run without preemption2) NT-based versions of Windows use a CPU scheduler based on a multilevel feedback queue, with 32 anteriority levels defined. It is intended to meet the following design requirements for multimode systems Give preference to short jobs. Give preference to I/O bound processes. Quickly establish the disposition of a process and schedule the process accordingly.All processes receive a priority boost after a wait event, but processes that have undergo a keyboard I/O wait get a larger boost than those that have experienc ed a disk I/O wait. play up processes given higher(prenominal) priority.3) Windows XP uses a quantum-based, preemptive priority scheduling algorithm. The scheduler was modified in Windows Vista to use the cycle counter register of modern processors to keep up track of exactly how many CPU cycles a thread has executed, rather than just using an interval-timer interrupt routine.Linux Process SchedulingFrom versions 2.6 to 2.6.23, the kernel used an O (1) scheduler. The Completely Fair Scheduler is the name of a task scheduler which was merged into the 2.6.23 release of the Linux kernel. It handles CPU resource allocation for executing processes, and aims to maximize overall CPU role while maximizing interactive performance. It uses that uses red-black trees instead of queues.Two sectiones of processesreal-time (soft deadlines)timesharing algorithmNormal process scheduling uses a prioritized, preemptive, credit-based policyScheduler always chooses process with the about credits to run.On each timer interrupt integrity credit is deducted until zero is reached at which time the process is preempted.If no ready process so all credits for a process calculated as credits = credits/2 + priority. This approach favors I/O bound processes which do not use up their credits when they run.The Round Robin and FIFO scheduling algorithms are used to switch between real-time processesWindows is by far the most(prenominal) popular proprietary personal computer operating system, while Linux is the most prominent free software operating system.WindowsLinux1)Process a)Address space, handle table, statistics and at least one thread b)No inherent parent/child relationship1) Process is called a Task a)Basic Address space, handle table, statistics b)Parent/child relationship c)Basic scheduling unit2) thread a) Basic scheduling unit b) Fibers cooperative user-mode threads2) Threads a)No threads per-se b)Tasks can act like Windows threads by sharing handle table, pelvic inflammat ory disease and address space c)P-Threads cooperative user-mode threads 3)windowingWindows has a kernel-mode Windowing subsystem. 3)windowing Linux has a user-mode X-Windowing system. 4)Two scheduling classes a) veridical time (fixed) priority 16-31 b) Dynamic priority 1-154)Has 3 scheduling classes a)Normal priority 100-139 b)Fixed Round Robin priority 0-99 c)Fixed FIFO priority 0-995)Higher priorities are favored a) Priorities of dynamic threads get boosted on wakeups b)Thread priorities are never lowered5)Lower priorities are favored a) Priorities of normal threads go up (decay) as they use CPUb)Priorities of interactive threads go down (boost) 6)Most threads run in variable priority levelsa)Priorities 1-15 b)A newly created thread starts with a base priority c)Threads that complete I/O operations experience priority boosts (but never higher than 15) d)A threads priority will never be below base priority6)Most threads use a dynamic priority policy a)Normal class simila r to the classic UNIX scheduler b)A newly created thread starts with a base priority c)Threads that block frequently (I/O bound) will have their priority gradually increase d)Threads that always exhaust their time stroke (CPU bound) will have their priority gradually decreased7)The Windows API function SetThreadPriority() sets the priority value for a specified thread a)This value, together with the priority class of the threads process, determines the threads base priority level b)Windows will dynamically adjust priorities for non-real-time threads 7)Nice value sets a threads base priority a)Larger determine = less priority, lower values = higher priority b)Valid nice values are in the range of -20 to +20 c)Non-privileged users can only specify positive nice value8) Real time scheduling in windows.Windows xp supports static round-robin scheduling policy for threads with priorities in real-time range (16-31) a) Threads run for up to one quantum. b) Quantum is reset to full turn on preemption. c) Priorities never get boosted.9) RT threads can lust important system services such as CSRSS.EXESe-Increase Base Priority Privilege is required to elevate a threads priority into real-time range.8) Real time scheduling in Linux.Linux supports two static priority scheduling policies Round-robin and FIFO (first in, first out) a) Selected with the sched-setscheduler( ) system call b) Use static priority values in the range of 1 to 99 c) Executed strictly in order of decreasing static priority9) RT threads can easily starve lower-priority threads from executing Root privileges or the CAP-SYS-NICE capability are required for the selection of a real-time scheduling policy10) Some System calls and DPC/armoured personnel carrier handling can cause priority inversion 10) Long running system calls can cause priority-inversion11) Scheduling timeslices in windowsThe thread time slice (quantum) is 10ms-120ms a)When quanta can vary, has one of 2 values11) Scheduling timeslices in Linux.The thread quantum is 10ms-200ms a)Default is 100ms b)Varies across entire range based on priority, which is based on interactivity level 12) Windows NT has always had an O (1) scheduler based on pre-sorted thread priority queues.12) The Linux 2.4 scheduler is O(n)If there are 10 active tasks, it scans 10 of them in a list in order to decide which should execute nextThis means long scans and long durations under the scheduler lock13) In windows (vista sp1) the time-slice varies -manual (user setting, window boost) as well as spontaneous (window boost).13) In Linux 2.6.28 the time-slice does not vary- manual(user setting, window boost) and automatic (window boost).14) In windows (vista sp1) CPU partitioning is not possible. 14) In Linux 2.6.28 CPU partitioning (CPU sets) is possible.15) Scheduler cargo balancing is not possible.15) Scheduler load balancing is possible.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.