Single queue vs. multi-queue multiprocessor scheduling

Operating systems have CPUsCentral Processing Units that allow for tasks to be executed. However, these tasks need to be processed in an order that is not conflicting and based on priorities. Moreover, as computational complexities increase, the CPU has to manage more tasks and allocate them to its single CPU. This is where multiprocessors come in use. Multiprocessors are the use of two or more CPUs in a computer system to allow for parallel processes and better performance.

Multiprocessor structure
Multiprocessor structure

In this Answer, we will discuss two approaches that use multiprocessors to delegate tasks.

Single queue scheduling

The SQMSSingle Queue Multiprocessor Scheduling policy takes a simplistic approach. It dequeues tasks from the global task queue and enqueues them into the CPU queue. This works by picking the "n" best tasks from the global queue based on priority and other policies and assigning them to each CPU where "n" is the total number of CPUs.

%0 node_1 A node_2 B node_1->node_2 node_3 C node_2->node_3 node_1689838621443 ... (repeat) ... node_3->node_1689838621443
Single CPU based on SQMS

The diagram above shows a single CPU system based on the SQMS.

Multiprocessor SQMS
Multiprocessor SQMS

The example above shows a situation where we have three CPUs available. The policy will pick the top three best tasks and assign each to each CPU.

Multi-queue scheduling

The MQMSMulti-Queue Multiprocessor Scheduling policy consists of multiple scheduling queues, and each queue can contain different scheduling algorithms. One can use the round-robin scheduler, while the other can use the shortest job first scheduler

This policy works by first placing each task dequeued from the global queue into one CPU queue depending on some heuristic like random allotment or based on the remaining capacity of each queue. Then, it is scheduled independently to prevent problems such as information sharing and synchronization.

Example MQMS
Example MQMS

The diagram above shows an example of tasks A, B, C, and D dequeued, and two CPUs are available. Each CPU is assigned a task based on the capacity heuristic.

Differences

Now that we know what each scheduling policy is, we can discuss the differences and limitations of each.

SQMS

MQMS

All tasks are placed into queues without any distinction.

Tasks are assigned based on categories such as priority, type, or other categories.

The same scheduling algorithm is applied to all queues.

Different queues can have different tasks based on characteristics.

All tasks inside queues are given the same priority.

Preferential treatment is given based on task priority.

Resource allocation is not optimal due to locking for SQMS code accesses.

Better resource allocation due to multi-queue structure.

Simpler to implement and manage.

More complex due to its structure.

Not scalable due to queue bottlenecks.

Scalable due to better parallelism and distributed structure.

Difficult to properly load balance.

Load balancing is inherently easier.

Difficult to manage fairness between tasks.

Provides easier fairness due to priorities.

Long running tasks can reduce responsiveness.

Maintains responsiveness through preferential treatment.

Conclusion

To conclude, we can summarize that the choice between SQMS and MQMS depends on the requirements, as both policies provide a good solution to their respective issues. However, we can generalize that for systems where all tasks are equally important and require a simple structure, SQMS is the suitable option. In contrast, MQMS is suitable when we require better control and optimization for our system where all tasks are unequal.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved