Beruflich Dokumente
Kultur Dokumente
Structure
7.0 Objective
7.1 Introduction
7.2 Motivation and Classification
7.3 Multi-Processor Interconnection
7.4 Types of Multi-Processor Operating System
7.5 Multi-Processor OS Functions and Requirements
7.6 Introduction of Parallel Computing (Distributed Operating System)
7.7 Introduction to Multi-Processor Synchronization
7.8 Summary
7.9 Exercises
Suggested Reading
7.0 Objective
7.1 Introduction
Multiprocessor systems are required to process huge amount of data with very high speed. These
types of systems are normally used in the environment like weather forecasting, satellite control, etc.
Motivation: Importantfactors to design multiprocessor systems are:
Increasing computation power
Sharing resources
Increasing reliability
Increasing computation power:
Computations are disintegrated into consecutive components which will be executed
simultaneously.
This decomposition task is performed by parallel algorithms.
Parallel programming concept is used to program such algorithms.
A few programming languages have been given with appropriate constructs for expressing
parallel computations.
To perform parallel computation, sequential components of a program are scheduled by
operating systemon the available processors.
Sharing resources:
The end user of amultiprocessing system is able to use available resources of another
multiprocessing system.
In a multiprocessor system,information is sharedasmost commonresources.
Memories, processors, and devices are also shared, and the power of computingisdistributed
among the multiprocessing systems.
Increasing reliability: A reliable (error tolerant) system is able to:
Notice the breakdown of the system components.
Separate the failure component.
Reallocate the computing tasks in the system, that is, rearrange the system and reschedule its
activity.
Notify the user to know about the new configuration by postingappropriate messages to the
terminal of the user.
Classification: Multi-processor are classified by their organized memory, and classified into two
types
Tightly coupled or shared memory multiprocessor:In a tightly coupled system, two or
more processing units (more than one processor) sharescommon memory space and I/O
Multiprocessor Systems | 3
devices, and are interconnected by a bus,in order to process the programs concurrently.Entire
computer system is managed by single operating system.These systems can perform better
and physically smaller than loosely-coupled system.This type of system is more expensive.In
this system, a short delay has occurred, if a message is sent from one computer to another
with high data rate; which means, the transferring of number of bits per second is large.For
instance, on the same printed circuit board the two CPU chips are connected by wire and
etched onto the board are likely to be tightly coupled.Tightly-coupledsystems ismuch more
energy efficient than clusters.Becauseof the considerable economies is realized through
designing the components to work altogether.The tightly coupled multiprocessor system is
shown in figure 7.1 below.
In multi-processing system, each processor can access any of the I/O units and memory modules. The
connectivity between these processors is achieved through interconnection networks to exchange data
between them. Therefore, interconnection networks determine the overall performance of
multiprocessor systems.
The physical forms to establish an interconnection network are
Time shared common bus.
Multiport memory
Crossbar switch
Multistage switching network.
Hypercube system.
Time shared common bus: A common bus is shared by all processors and memory of a system.In
this arrangement,all processors are attachedwitha common path to the memory unit. The local
memory or cache memory isattached with each of the CPU.
Multiprocessor Systems | 5
Disadvantages:
Only single processor is communicated with the memory and other processor at any given
time.
The average transfer rate is limited within the system by the speed of the single path.
Multiport memory: In this system, dissimilar memory modules and CPUs have distinct buses. The
module has internal control logic for determiningthe port which accesses memory at any specified
time. To resolve conflicts of memory access,priorities are assigned to each of the memory port.
Advantages:
Due to multiple paths, high transfer rate is achieved.
Disadvantages:
It needs expensive memory control logic and a big number of cables and connections.
Crossbar switch: It consists of a several cross-points and is assigned at intersections between
memory module paths and processor buses. A switch can determine a path from a processor to a
memory module.Figure 7.5 below shows the crossbar switch.
This type of networks are designed with the small number of elementary crossbar switches and
connected in multiple layers. The switches are implementedin 4 types of connections: crossed
straight, upper and lower broadcast. All the elementary switches canbe controlled concurrently. The
extension cost for such a network is relatively low.
For this type of networks, there is a restriction to implement arbitrary connections in the switch if
some connections are already set. For this reason, these networks are called blocking networks. A
multistage connection network for parallel systems has been shown below in Figure 7.7 below.
Hypercube system: This type of network is also knownas a binary n-cube network with 2n nodes and
arranged as an n-dimensional cube. Suppose a single point is labeled as 0 and called a 0-cube. Now,
replicating this 0-cube and placing this copy at a distance of one unit away. Connect these two nodes
and labeled the replicated node as 1. As shown in figure 7.8 below. This is called 1-cube. Further by
extending this idea you will get 2- cube, 3-cube as shown in figure 7.8 below.
Advantages:
The bisection width can be very high and the diameter is low. It makes the hypercube an
attractive organization.
Drawbacks:
The number of edges per node is a function (logarithmic) of network size and making it
difficult to scale up, and the maximum length of edge increases when the network size
increases.
In multi-processing system various types of organizations are possible. Below you will see three of
them.
Each CPU has its own operating system:
This type of multiprocessing operating system is organized by partitioning memory as the number of
CPUs is connected with the system and each partition of memory is allocated to each CPU as a
private memory. Each CPU also has its own copy of a private OS. Hence, n CPU means n separate
computer. For optimization purpose, each CPU shares operating system code and private memory to
store its own operating systems private data, as shown in Figure 7.10 below.
Functions: Multiprocessing system is also called symmetric multiprocessing model, where each of
the processor executes an indistinguishable copy of OS and they are communicated with each other.
Multiprocessor Systems | 11
Here, a processor is given a certain task. The system is controlled by a master processor. This type
ofarrangement is called a master-slave relationship. It will save money in compare to single processor
systems, since the processors share the power supplies,peripherals, and additional devices. The key
advantage of this type of system is to do more workwithina less time period. Furthermore, these
systems provide more reliability in the circumstances where one processor fails and that could not
stop the system to work further; just the system will slow down for some time.
Requirements: To work multiprocessing OS efficiently, the computer system has required the
following:
Motherboard support: A motherboard has the ability to handlemany processors. That is
theextra slotsor sockets for the additional chips are able to handle the multiprocessing
environment.
Processor support: All of the tasks of multiprocessing system arehandled by the OS. The
operating systemassignsthe different tasks to the several processors within the system. The
Applicationsin multiprocessing system arecalled threaded, because they are divided intosub
routines to run independently. Which means the OSruns these threads on many
processorsconcurrently and improving the performance.Hence the processes can execute in
parallel. Usually the parallel processing is needed in the area like expert systemand artificial
intelligence,weather forecasting, image processing etc.
In this system, resources are shared dynamically to the several processors may cause a
potential bottleneck. There are three key sources of contention that is founded in this type of
operating system:
o Locking system: for providingthe safe access of resources which are shared tomany
processors and this requireda locking scheme to protect them. The main purpose of
the locking system is to serialize accesses of protected resources by many processors.
Unmanageablecustom of locking can severely reduce the systemperformance. This is
managed by the use of locking scheme, replacing locks with lock-free algorithms,
escaping long critical sections, ignoring sharing altogether, or whenever possible.
o Shared data:
Several processors are continuously accessing the shared data and many of them with
data write also. They are serialized by the protocol of cache coherence. Delay in
serialization can affect the system performance. Furthermore, the cache coherence
traffics bursts saturate the interconnection network or the bus of memory and slow
down the whole system.This type of problem is removed through avoiding the
sharing of data or decrease the write access rate of shared data by replication
mechanism.
o False sharing:
False sharingoccurs when distinct data items used by several processors are placed
next to each other within the memory.Updating simultaneously the individual
elements in the same cache line that has come from distinct processors will
12 | Operating System
invalidatethe whole cache lines. However, these updates are independent of each
other. Every update of element of a cache line will invalidate the line. And this will
be seen by the other processors. They have to fetch a recent copy of the line from
memory, although theaccessed element has not been modified. As we knowthe cache
coherency is maintained on thebasisof cache-line rather than for individual elements.
This will cause an increase in interconnect traffic and hence overhead. Also, when
the cache-line is updating, access to the elements in the line is prohibited.
Apart from this, this type of system developer mustdelivermaintenance for
effectivelyexecutingapplication of user on the multiprocessor. Some of the support
includestechniquesofmigration across processors, task placement, placement of
physical memory where most of the pages of memory are used by the application is
placedwithin local memory.
In a distributed system,a number of processors do not share a clock or memory. Instead, each
processor contains an own local memory. The processors can communicate with each other overthe
several communication networks, for exampletelephone lines or high-speed buses.
Motivation:The processors of distributed system may differ in function and size. They include
workstations, small microprocessors, and minicomputers.These processors have different names, for
instancenodes,sites, machines,computers, and hosts.The structure of a distributed system is shown in
Figure 7.13 below.
CPUs get a 0 value from the TSL instruction. Hence, both ofthem have access to the critical region
and failing the mutual exclusion property.
Figure 7.14: The TSL instruction fails when the bus is not locked
To avoid this difficulty, the TSL instruction must lock the bus, stoppingother CPUs from accessing it
and accessing both memories, after that the bus is unlocked.
Anothergood idea is giving each CPU to get the mutex as its own private lock variable, as shown in
Figure 7.15below. The variable must reside in adifferently unused cache block foravoiding conflicts.
This mechanism works as a CPU is failing to acquire thelock, and then it allocates a lock variable and
added itself at the last position of a list of CPUs where they are waitingfor that lock. If the present
lock holder leaves the critical region, it releases theprivate lock to the first CPU on that list. This
CPUthen accesses the critical region. After completing the task, it releases the lock to its successor,
and so on. It is effectiveand free from starvation.
7.8 Summary
7.9 Exercises
A. Uniprocessor computer
B. Computer
C. Processor
D. System
16 | Operating System
A. Complex
B. Locks
C. Lockstep
D. None
11. What are the important factors to design multiprocessor systems? Explain each of the factors.
12. Write down the difference between the tightly coupled and loosely coupled multiprocessor
system.
13. What are the physical forms to establish an interconnection network of multiprocessor
system?
14. Explain Multistage switching network and Hypercube system interconnection network.
15. Describe three types of multiprocessor operating system.
16. Write down the function of multiprocessing operating system.
17. Write down the basic requirement of multiprocessing operating system to work efficiently.
18. Explain false sharing?
19. What is parallel computing? What are the main reasons to design distributed systems?
Briefly explain all of them.
20. What is multiprocessor synchronization?
21. How TSL (Test and Set Lock) instruction fails mutual exclusion property?
Suggested Reading
1. Silberschatz, Abraham, et al. Operating system concepts. Vol. 4. Reading: Addison-wesley,
1998.
2. Romero, Fernando. "Operating Systems. A concept-based approach." Journal of Computer
Science & Technology 9 (2009).