4.4.Windows Thread Scheduling (Core)
The objective of multiprogramming is to have some process (or thread) running at all times, to maximize CPU utilization. For a uniprocessor system, there will never be more than one running process (or thread). If there are more processes (threads), the rest will have to wait until the CPU is free and can be rescheduled.
Scheduling is a fundamental operating system function. Almost all computer resources are scheduled before use. The CPU is, of course, one of the primary computer resources. Thus, its scheduling is central to operating system design.
Windows uses a priority-elevation scheme to CPU scheduling. This section explains the single-processor scheduling algorithm.
Book: pp.325-347 (Thread Scheduling)
Video: 7.3 (Thread Scheduling)
4.5.Advanced Windows Thread Scheduling (Core/Advanced)
This section explains advanced scheduling details such as time slice expiration, how waiting threads are represented, and other priority elevations (boosts) applied to threads. It also covers details with respect to multiprocessor support in Windows scheduling.
In this section, we describe the specific algorithms used to choose which threads run where and when, and examine the additional information Windows maintains to track thread and processor state on multiprocessor systems and the two new types of multiprocessor systems supported by Windows (hyperthreaded and NUMA).
Book: pp.348-369 (Idle Thread, Priority Boosts, MP scheduling)
4.6.Scheduling and Dispatch labs, quizzes, and assignments
Besides self-study and testing materials, this section provides in-depth insight in the Windows mechanisms for managing processes and threads through the various labs, among them:
-
Viewing ready threads
-
Examining and specifying process and thread priorities
-
Monitor thread scheduling state changes
-
Watching foreground priority boosts and decays
-
Viewing the Job object
-
Examining EPROCESS and ETHREAD blocks
5.Memory Management – (Core) OS5
(basic: 2-3 hours, basic+advanced: 4-5 hours, homework assignment)
5.1.Memory Management for Multiprogramming (Core)
The main purpose of a computer system is to execute programs. These programs, together with the data they access, must be in main memory (at least partially) during execution.
To improve both the utilization of the CPU and the speed of its response to its users, the computer must keep several processes in memory. There are many different memory-management schemes. These schemes reflect various approaches to memory management, and the effectiveness of the different algorithms depends on the particular situation. Selection of a memory-management scheme for a specific system depends on many factors, especially on the hardware design of the system. Each algorithm requires its own hardware support.
Since main memory is usually too small to accommodate all data and programs permanently, the computer system must provide secondary storage to back up main memory. Most modern computer systems use disk as the primary on-line storage medium for information.
5.2.Windows Memory Manager (Core)
The Windows OS implements a virtual memory management scheme, fulfilling two main tasks:
Translating, or mapping, a process‘s virtual address space into physical memory so that when a thread running in the context of that process reads or writes to the virtual address space, the correct physical address is referenced.
Paging some of the contents of memory to disk when it becomes overcommitted – that is, when running threads or system code try to use more physical memory than is currently available – and bringing the contents back into physical memory when needed.
Book: pp.375-422 (Memory Manager, Memory Pools, Address Space Layouts)
Video: 8.1 (Memory Management Overview), 8.3 (Physical Memory Management)
5.3.Windows Memory Management Internals (Core)
The memory manager provides a set of system services to allocate and free virtual memory, share memory between processes, map files into memory, flush virtual pages to disk, retrieve information about a range of virtual pages, change the protection of virtual pages, and lock the virtual pages into memory.
Like other Windows OS executive services, the memory management services allow their caller to supply a process handle, indicating the particular process whose virtual memory is to be manipulated. For example, if a process creates a child process, by default it has the right to manipulate the child process‘s virtual memory. This feature is used by subsystems to manage the memory of their client processes.
Book: pp.425-482 (Address Translation, Page Fault Handling, Working Sets)
Video: 8.2 (Shared Memory and DLLs), 8.4 (Page Files)
5.4.Windows Memory Management APIs (Core/Elective)
Most programs require some form of dynamic memory management. This need arises whenever it is necessary to create data structures whose size cannot be determined statically when the program is built. Search trees, symbol tables, and linked lists are examples of dynamic data structures.
The Windows API provides flexible mechanisms to manage a program‘s dynamic memory segments such as page granularity functions as well as heap functions. Windows also provides memory-mapped files to associate a process‘s address space directly with a file. The operating system manages all data movement between the file and memory, and the programmer never needs to deal with ReadFile(), WriteFile(), SetFilePointer(), and the other file I/O functions. With memory-mapped files, the program can maintain dynamic data structures conveniently in permanent files. Furthermore, memory-based algorithms can process file data.
Book: pp.382-400 (Services the Memory Manager Provides)
5.5.Memory Management labs, quizzes, and assignments
Besides self-study and testing materials, this Section provides in-depth insight in the Windows mechanisms for managing memory through the various labs, among them:
-
Viewing system memory information
-
Accounting for physical memory use
-
Viewing memory mapped files
-
Determining maximum pool sizes
-
Examining the page directory and page directory entries (PDEs)
-
Translating logical to physical addresses
-
Viewing page file usage
-
Viewing process working set sizes
-
Viewing page fault behavior
Share with your friends: |