Multiprocessing is the use of two or more processors to share system resources. Multiprocessing enhances a system's performance by increasing reliability and enhancing faster processing.
For example, consider a simple set of jobs as follows:
When the execution is done using a single processor, only one job could be executed at a time. The other jobs have to wait until the job which is being currently executed runs to completion or preempted. This seriously degrades system performance since the waiting queues increase over time and the throughput is decreased. Some jobs may even lead to starvation (more about these concepts in the blog post on deadlocks and starvation).
However, when the execution is done using multiple processors, many jobs can execute at the same time. This does not eliminate waiting queues or aging, but generally reduce them. Moreover the throughput is increased while decreasing the turnaround time.
However, with every new concept comes a new problem. When multiple processors are used, there should be a configuration of the processors and we should configure the processor set in an appropriate way so as to obtain the maximum efficiency to our system.
Several multiprocessing configurations are used. However, this blog post will discuss the main three configurations:
1. Master/slave configuration
2. Loosely coupled configuration
3. Symmetric configuration
Master/slave configuration
This configuration is an asymmetric configuration. Consider the following system depicting a typical master/slave configuration.
A typical master/slave configuration in which the Master processor masters all other slave processors. Slave processors are only used to increase system performance and cannot access I/O devices directly.
This sometimes causes heavy workload on the master processor.
As shown in the figure, every time a slave processor needs to access I/O devices, it should go through the master processor. This is a severe burden on the master processor as if most or all of the jobs are I/O device bound, then the master processor will be frequently interrupted by the slave processors for I/O device access. This reduces the efficiency of the master processor hence the system.
Every time a slave processor needs to access I/O devices, it should go through the master processor.
Moreover, when a slave processor needs to be free, it should wait until the master processor is free. This leads to poor use of system resources. For example, a slave processor may be waiting to be free just when it has finished a heavy job. But while it was waiting for the master processor to become free, another job may be assigned to it, which now it has to attend. This way slave processor may have to wait fir prolonged waiting periods until the master processor is free.
Also, the reliability is very less in this type of configuration. For instance, what would happen if the master processor fails. Although working as usual, slave processors cannot address the jobs posted by the user or for the background processors. These will also be in idle and the entire system will shut down. Therefore, the whole system depends upon the master processor.
As discussed above, master/slave processor configuration is one of the worst processor configurations ever built. Then, why and where are these type of configurations used?
The answer lies in the structure itself. By benchmarks, this type of configuration is the most simple and there exist a hierarchy among processors. Therefore, this type of configuration could be easily used in a hybrid operating system environment.
To understand this concept refer to the image below.
The interactive jobs which need quick response or turnaround time are assigned to the front end processor and the batch jobs which do not need faster turnaround time (as compared to interactive jobs) are assigned to the back end processors.
Therefore, the master/slave configuration is necessary in such a system which needs a hierarchy between processors configured.
Loosely coupled configuration
In loosely coupled configuration several processors are used and each have access to their own memory and I/O devices while process synchronization is maintained.
The figure below shows the loosely coupled configuration.
In loosely coupled configuration each processor has its own main memory and I/O devices. Processor hierarchy in master/slave configuration is eliminated but the system is complex as a result.
When jobs are allocated they may have to wait for a respective processor or most commonly until one of the processors are free.
Reliability of such a system is high. For example when Processor 2 shuts down, incoming jobs could be allocated to either processor 1 or 2. However, the I/O devices allocated should be manually allocated to other processors that were previously allocated to the failed processor. Moreover, processor troubleshooting is difficult.
Loosely coupled configuration is also a type of asymmetric configuration.
Symmetric configuration
Symmetric configuration is similar to master/slave configuration in that all processors share the main memory but differs in that the overall configuration is symmetric because all processors have access to the I/O devices. This is the most difficult type of configuration to implement, but on the other hand it is the most reliable.
The figure below shows the symmetric configuration of processors.
In symmetric configuration, each processor has access to main memory and I/O devices and the overall structure is symmetric.
Symmetric configuration has four advantages over the loosely coupled configuration.
1. It is more reliable
When a processor fails, the incoming jobs can be assigned to other processors. Troubleshooting is easy.
2. It uses resources effectively
3. It can balance loads well
4. It can degrade gracefully in the event of a failure
Therefore, accounting these four criterion it can be said that symmetric configuration is advantageous over the asymmetric configuration.
But, this is the most complex system to build and maintain. Besides process synchronization is important in this type of configuration.
For example, consider a simple set of jobs as follows:
When the execution is done using a single processor, only one job could be executed at a time. The other jobs have to wait until the job which is being currently executed runs to completion or preempted. This seriously degrades system performance since the waiting queues increase over time and the throughput is decreased. Some jobs may even lead to starvation (more about these concepts in the blog post on deadlocks and starvation).
However, when the execution is done using multiple processors, many jobs can execute at the same time. This does not eliminate waiting queues or aging, but generally reduce them. Moreover the throughput is increased while decreasing the turnaround time.
However, with every new concept comes a new problem. When multiple processors are used, there should be a configuration of the processors and we should configure the processor set in an appropriate way so as to obtain the maximum efficiency to our system.
Several multiprocessing configurations are used. However, this blog post will discuss the main three configurations:
1. Master/slave configuration
2. Loosely coupled configuration
3. Symmetric configuration
Master/slave configuration
This configuration is an asymmetric configuration. Consider the following system depicting a typical master/slave configuration.
This sometimes causes heavy workload on the master processor.
As shown in the figure, every time a slave processor needs to access I/O devices, it should go through the master processor. This is a severe burden on the master processor as if most or all of the jobs are I/O device bound, then the master processor will be frequently interrupted by the slave processors for I/O device access. This reduces the efficiency of the master processor hence the system.
Every time a slave processor needs to access I/O devices, it should go through the master processor.
Moreover, when a slave processor needs to be free, it should wait until the master processor is free. This leads to poor use of system resources. For example, a slave processor may be waiting to be free just when it has finished a heavy job. But while it was waiting for the master processor to become free, another job may be assigned to it, which now it has to attend. This way slave processor may have to wait fir prolonged waiting periods until the master processor is free.
Also, the reliability is very less in this type of configuration. For instance, what would happen if the master processor fails. Although working as usual, slave processors cannot address the jobs posted by the user or for the background processors. These will also be in idle and the entire system will shut down. Therefore, the whole system depends upon the master processor.
As discussed above, master/slave processor configuration is one of the worst processor configurations ever built. Then, why and where are these type of configurations used?
The answer lies in the structure itself. By benchmarks, this type of configuration is the most simple and there exist a hierarchy among processors. Therefore, this type of configuration could be easily used in a hybrid operating system environment.
To understand this concept refer to the image below.
The interactive jobs which need quick response or turnaround time are assigned to the front end processor and the batch jobs which do not need faster turnaround time (as compared to interactive jobs) are assigned to the back end processors.
Therefore, the master/slave configuration is necessary in such a system which needs a hierarchy between processors configured.
Loosely coupled configuration
In loosely coupled configuration several processors are used and each have access to their own memory and I/O devices while process synchronization is maintained.
The figure below shows the loosely coupled configuration.
In loosely coupled configuration each processor has its own main memory and I/O devices. Processor hierarchy in master/slave configuration is eliminated but the system is complex as a result.
When jobs are allocated they may have to wait for a respective processor or most commonly until one of the processors are free.
Reliability of such a system is high. For example when Processor 2 shuts down, incoming jobs could be allocated to either processor 1 or 2. However, the I/O devices allocated should be manually allocated to other processors that were previously allocated to the failed processor. Moreover, processor troubleshooting is difficult.
Loosely coupled configuration is also a type of asymmetric configuration.
Symmetric configuration
Symmetric configuration is similar to master/slave configuration in that all processors share the main memory but differs in that the overall configuration is symmetric because all processors have access to the I/O devices. This is the most difficult type of configuration to implement, but on the other hand it is the most reliable.
The figure below shows the symmetric configuration of processors.
In symmetric configuration, each processor has access to main memory and I/O devices and the overall structure is symmetric.
Symmetric configuration has four advantages over the loosely coupled configuration.
1. It is more reliable
When a processor fails, the incoming jobs can be assigned to other processors. Troubleshooting is easy.
2. It uses resources effectively
3. It can balance loads well
4. It can degrade gracefully in the event of a failure
Therefore, accounting these four criterion it can be said that symmetric configuration is advantageous over the asymmetric configuration.
But, this is the most complex system to build and maintain. Besides process synchronization is important in this type of configuration.
Comments
Post a Comment