Multiprocessing is a common word we come across while discussing the characteristics of an operating system. As the name suggests, it refers to using multiple processors in a system to increase efficiency and performance. Multiprocessing, in turn, supports multithreading, i.e. running multiple threads/processes concurrently. Let us discuss a Multiprocessing operating system in detail.
What is Multi- Processing Operating System?
A Multiprocessing operating system uses multiple central processing units within a single system. It enables a system to support more than one processor and divide the tasks among them. Every process requires a CPU for its execution. So this allows multiple processes to execute parallelly on different processing units.
Working of Operating System
Typically, in a multiprocessing operating system, each processor runs an identical copy of the OS and can communicate with each other. To run such a system efficiently, the following components are required.
Motherboard bracket - The motherboard is equipped with sockets and slots to connect and attach multiple processors.
Processor support - Processors should be capable of functioning in a multiprocessing environment.
False sharing - occurs when unrelated data items used by different processors are located next to each other in the memory.
Shared data - Multiple processors share the same data items, including the main memory.
Locking System - A Locking system provides safe access to resources shared by multiple processes.
In a multiprocessing operating system, many processes can be executed concurrently. If four processes are ready for execution, each is allocated to a different processor. If it's a dual-core processor, two processes can execute two processes simultaneously and thus will be two times faster than a single processor system. Similarly, a quad-core processor will be four times faster than a single processor. In some cases, various small processing units are connected to perform the main processing. So, even if one of the small processing units fails, the others will automatically start execution.
Types of Multiprocessing OS
Asymmetric Multiprocessing operating system
This involves one processor behaving like a master and the other processors as slaves. The master processor assigns processes ready for execution to the slave processors. A ready queue is maintained by the master processor from which slave processors receive the processes they need to execute. In an asymmetric system, a scheduler made by the master processor assigns processes to other processors.
Advantages of Asymmetric Multiprocessing operating system
Since a master CPU allocates jobs to other processors, the number of conflicts that may occur is significantly reduced.
The overall process of execution is faster.
Easier to design and Handle.
Disadvantages of Asymmetric Multiprocessing operating system
Sometimes, all processors may not get an equal share of jobs. Some processors might be overly burdened.
If the processor handling a specific job fails, the entire system crashes.
Common computer clocks, buses, memories, and peripherals. Also Read, FCFS Scheduling Algorithm
Symmetric Multiprocessing operating system
There are no master-slave relationships among the processors, and all processors have their own process scheduler. A global queue is maintained in which all the ready-to-execute processes are stored. All processors receive processes from this global queue. Sometimes, two processors may get the same process. Problem locking is used to solve this conflict. The local scheduler is attached to every processor to maintain the balance and ensure optimum CPU utilization. The throughput of asymmetric Multiprocessing operating system is more as many processes get executed concurrently.
Advantages of Symmetric Multiprocessing operating system
It is fault-tolerant. Failure of a single process does not crash the entire system like asymmetric multiprocessing. b. It is a reliable system. c. Since multiple processors can run the jobs, the number of processes executed per unit time also increases.
Disadvantages of Symmetric Multiprocessing operating system
It has a complex design. b. Tough to handle. c. Costlier compared to asymmetric multiprocessing.
Advantages of Multiprocessing Operating System
Increased throughput and performance. Throughput is the rate of execution of processes per unit of time. Since multiple processors can execute multiple processes concurrently, the rate of process execution is increased.
Reliability. Since multiple processors work together as a single unit, the others will continue to execute without any interruptions even if one fails.
Multiprocessing systems tend to consume less electricity and power when compared to a single processing system. This is because the processor in a single processing system has more load than the ones as part of a multiprocessing unit. You can also explore Advantages of Operating System here.
Disadvantages of Multiprocessing Operating System
Multiprocessing operating systems have a more complex architecture when compared to a single processor OS.
It may require a bigger memory as multiple processors share the same main memory.
The system crashes if the processor in charge of a particular task fails.
Multiprogramming and Multiprocessing Operating System
Multiprogramming and Multiprocessing are often thought to be similar, but they are quite different. Let us explore the differences between the two.
Multiprogramming
Multiprocessing
It is the interleaved execution of two or more processes by a single processor.
It is the simultaneous execution of two or more processes by multiple processors.
It occurs by switching from one process to another. This is also known as context switching.
It occurs through parallel processing.
It executes a portion of the program and then a segment of another in a consecutive time period.
It is possible to work on several program segments of one or more programs simultaneously.
Less throughput and efficiency.
High throughput and efficiency.
Frequently Asked Questions
What is single and multiprocessor system in OS?
A single-processor system has one CPU, while a multiprocessor system has multiple CPUs. Multiprocessors can execute tasks concurrently, providing better performance and multitasking capabilities in operating systems.
What are the 2 types of multiprocessing OS?
Symmetric Multiprocessing (SMP): All processors are treated equally and can execute any task.
Asymmetric Multiprocessing (AMP): Processors have different roles, such as a master processor handling the OS and other processors for specific tasks.
What is the use of multiprocessor?
Multiprocessors are used to improve system performance by executing multiple tasks in parallel, enhancing multitasking, handling complex computations, and supporting high-demand applications, making them suitable for servers and high-performance computing.
Conclusion
In this article, we have extensively discussed Multiprocessing operating systems. We also learned about the two types of multiprocessing in an OS. We then moved on to discover the working pros and cons of a multiprogramming operating system. Lastly, we discussed the differences between multiprogramming and multiprocessing.