An Intuitive and Easy Guide To Multi-Processor Scheduling (Part-7)
This blog attempts to address a number of issues related to multiprocessor scheduling. We concentrate on systems in which the processors are same, i.e., functionally homogenous. We may then run any task in the queue on any available CPU.
Let us look at different techniques to multi-processor scheduling:
Approaches to Multiple-Processor Scheduling
One approach to CPU scheduling in a multiprocessor system has all scheduling decisions, I/O processing, and other system activities handled by a single processor — the master server. The other processors execute only user code. This asymmetric multiprocessing is simple because only one processor accesses the system data structures, reducing the need for data sharing.A second approach uses symmetric multiprocessing (SMP), where each processor is self-scheduling. All processes may be in a common ready queue, or each processor may have its own private queue of ready processes.
Processor Affinity
Consider what happens to cache memory when a process has been running on a specific processor. The data most recently accessed by the process populate the cache for the processor. As a result, successive memory accesses by the process are often satisfied in cache memory. Now consider what happens if the process migrates to another processor. The contents of cache memory must be invalidated for the first processor, and the cache for the second processor must be repopulated.
Because of the high cost of invalidating and repopulating caches, most SMP systems try to avoid migration of processes from one processor to another and instead attempt to keep a process running on the same processor. This is known as processor affinity — that is, a process has an affinity for the processor on which it is currently running.
Load balancing
On SMP systems, it is important to keep the workload balanced among all processors to fully utilize the benefits of having more than one processor.
Otherwise, one or more processors may sit idle while other processors have high workloads, along with lists of processes awaiting the CPU. Load balancing attempts to keep the workload evenly distributed across all processors in an SMP system.
It is important to note that load balancing is typically necessary only on systems where each processor has its own private queue of eligible processes to execute.On systems with a common run queue, load balancing is often unnecessary, because once a processor becomes idle, it immediately extracts a runnable process from the common run queue.
Multicore processor
Traditionally, SMP systems have allowed several threads to run concurrently by providing multiple physical processors. However, a recent practice in computer.
Hardware has been to place multiple processor cores on the same physical chip, resulting in a multicore processor. Each core maintains its architectural state and thus appears to the operating system to be a separate physical processor. SMP systems that use multicore processors are faster and consume less power than systems in which each processor has its own physical chip.
Quiz Time 🤔
- A process can be ___________
a) single threaded
b) multithreaded
c) both single threaded and multithreaded
d) none of the mentioned - In a……………… approach for multiprocessor thread scheduling and processor assignment, processes are not assigned to a particular processor.
A) Load Sharing
B) Gang Scheduling
C) Dynamic Scheduling
D) Load Scheduling - In …………………. approach, the scheduling routine of the operating system is run of that processor to select the next thread.
A) Load Sharing
B) Gang Scheduling
C) Dynamic Scheduling
D) Load Scheduling
Wrap Up (Conclusion)
This blog has explained what multi-processor scheduling is and why it is necessary. We also looked at several methods to multi-process scheduling and the challenges that come with them. In the next blog, we will look at real-time scheduling and try to apply the principles described in this blog.
This completes the part-7 of this blog series on CPU Scheduling.
Thanks for reading!
We hope you found the content interesting. If you enjoy it, please share it with your friends. Something not stated, or would you want to offer your thoughts? Please leave a remark below, and we will respond as soon as possible. 😉