In a single processor system, scheduling is easy because only one processor has to schedule repeatedly. It is one-dimensional scheduling. But in a multiprocessor system, scheduling is somewhat complicated. The scheduler has to decide which process to run and which CPU to run it on. Multiprocessor scheduling is two-dimensional scheduling. Therefore to manage this extra dimension, multiprocessing has to face a number of issues are given below.
Issues in Multiprocessor scheduling
In parallel programming, there is a task force which consists of several tasks. In scheduling, the ready task is assigned to the processor, so performance is increased. It may be a single program or multiple, processes are communicated to each other via a shared variable or message passing. Scheduling a processor in a multiprocessor system is a somewhat difficult problem. So there are some issues in multiprocessor scheduling following are the 3 issues in.
1. Cache Corruption
If multiple tasks are executing successfully by different applications processors, that means for every task switch, a data needed by the previous task must be flush or purged from cache and new data should be brought into cache for new task, initially there was a very high miss ratio when the processor was switching to another task, this problem is called cache corruption. It can degrade the performance. To handle this situation is Important.
2. Context Switching Overheads
In context switching, there is a need for execution of a large number of instructions to store and save the registers to initialize the register, to switch address space, etc. Due to this, the progress of execution of applications is reduced automatically. (In addition, context switching causes the problems of Cache Corruption.)
3. Preemption Inside Spinlock (Controlled Critical Section)
This happens when a task is preempted inside a critical section when there are other tasks spinning the lock for entering the same critical section. These tasks waste the CPU cycles because they continue to be in spinning mode until the preempted task is reschedule and complete the execution of the critical section.
If the critical section is small, Then a task preempted for a very short time but the task which is waiting for the preempted process is very long so that task needs to wait significantly. This problem will more be complicated when a few large critical sections are arises frequently.