NAME: Lab 4 Monitoring Processes and Threads Scheduling ITSC205: Operating Systems Internals $8 SAIT Table of Contents Lab Outcome(s)…..... Reading Introduction. 1.0 2.0 3.0 4.0 Process and Threads Scheduling with
Performance Monitor tool. Process Explorer to analyze Processes/Threads behavior. Linux Process Scheduling -CFS ............... POSIX Threads..... Labs must be submitted by the due date for full credit. After due date late submissions will receive a grade of zero (0). SAIT EVALUATION: Analyze threads scheduling using Windows performance Monitor Analyze processes/threads Sys-Internals tool - Process Explorer Linux Process Scheduling -CFS POSIX Threads TOTAL MARK I certify that the work submitted in this assignment is my own and that it has not been taken in whole or in part from any other source. I understand that the penalty for plagiarism will include a grade of zero (0) for this assignment plus disciplinary action in accordance with SAIT policies. Signature: 15 10 10 15 50 ~~~ ↳ O 2 2 2 5 7 9 .14 Lab Outcome(s) Examine process and threads activity using various windows monitoring tools. Analyze process scheduling policy and priorities ● $SAIT Reading Textbook sections 20.4.2 (Processes and Threads), 20.5 Scheduling (Tread and Real Time Scheduling), 21.3.4.3 (Windows Threads) and 21.3.4.4(Thread Scheduling) Introduction The key to current operating systems is the ability to execute multiple processes simultaneously. It is essential that the operating system optimizes the execution order of the processes to ensure efficient and equitable use of the CPU resources. The objective of multiprogramming is to optimize CPU utilization. Processes are scheduled by a CPU scheduler such that CPU usage is maximized. The operating system scheduler in the kernel. All the scheduling routines in the kernel are called in windows. The scheduler or dispatcher determines what thread can execute next based on scheduling algorithms. The most common algorithms are priority and Round Robin (RR). Windows implements preemptive priority algorithm. Linux implements RR and FIFO policies for real time processes and SCHED_OTHER policy for Time Sharing processes called also Completely Fair Scheduler (CFS) based on red-black tree data structure. 2 ITSC205: Lab 4 © 2023, Southern Alberta Institute of Technology Process/ Threads Scheduling Concepts Windows processes is merely a container, threads do the work and consume resources. Every process has at least one thread and the thread is the entity within a process that Windows schedules for execution. Threads are kept in executive thread blocks (ETHREAD) and the thread environment blocks (TEB) in user space. KTHREAD Create and exit times Process ID Thread start address Impersonation information ALPC message information Timer information Source: https://www.microsoftpressstore.com/articles/article.aspx?p=2233328&seqNum=4 Dispatcher header Total user time Total kernel time Thread-scheduling information Trap frame Synchronization information List of pending APCs Timer block and wait block List of objects thread is waiting on 3 ITSC205: Lab 4 © 2023, Southern Alberta Institute of Technology TEB EPROCESS Access token Pending I/O requests Kernel stack information System service table Thread-local storage array $SAIT TEB Source: https://www.microsoftpressstore.com/articles/article.aspx?p=2233328&seqNum=4 Windows implements a variation of pre-emptive priority scheduling algorithm where priority is calculated based on the process priority class and the thread priority level. The scheduler has a "Priority Boost" feature where a thread's priority is increased after waiting for I/O - the amount depends of what type of I/O. (e.g. keyboard would receive a greater boost than disk.) A thread's priority is decreased if it used up its quantum. A background process that is brought to the foreground will have 3x the quantum to execute. Real-time time critical Real-time Levels 16-31 Real-time idle Dynamic time critical Dynamic Levels 1-15 Dynamic idle 31 24 65 16 15 Real-time 13 High 10 Above Normal Normal Below Normal 4 ITSC205: Lab 4 © 2023, Southern Alberta Institute of Technology 4 1 0 Used for zero page thread-not available to Win32 applications $SAIT Idle Source: Windows Internals 7th edition, Mark E. Russinovich and David A. Soloman, Microsoft Press, 2017, pg. 215.