COE4590 - 9 - Shared Mem - MessgPassing
COE4590 - 9 - Shared Mem - MessgPassing
(Lecture-9)
(Shared Memory vs. Message Passing Systems)
BY
ABDUS SAMAD
Multiprocessor Systems
Asynchronous parallelism through a set of interactive
processors.
A number of shared resources like Memory, I/O,
Databases etc. are used.
A multiprocessor system consists of several
processors of approximately comparable capabilities.
The entire system is controlled by a single O.S
Besides shared memories and I/O devices, each
processor has its own local memory and private
devices.
Interconnection Network is used to provide
communication between memories and processors.
Types of Multiprocessor Systems
Multiprocessor systems are classified by
the way their memory is organized. There
are two major categories:
1. Shared Memory Systems or (Tightly Coupled
Systems).
2. Message Passing Systems or (Loosely
Coupled Systems) also known as Distributed
Memory Systems.
Shared Memory Systems
Shared memory is a Global memory that may be
simultaneously accessed by multiple processors.
Communication between tasks running on different
processors is performed through writing to and
reading from the global memory.
All inter-processor coordination and synchronization is
also accomplished via the global memory.
Access to shared memory is balanced, therefore, they
are also known as SMP (Symmetric Multiprocessor
System).
Tasks and/or processors communicate in a highly
synchronized fashion.
Processors may also have some local memory.
Shared Memory Systems
A shared memory region is established which is used by the
processes for data communication.
This memory region is present in the address space of the
process which creates the shared memory segment.
The processes who want to communicate with this process
should attach this memory segment into their address space.
Shared Memory Systems
Depending upon the interconnection network, a
shared memory system has three different
categories:
1. Uniform Memory Access (UMA)
In UMA, a shared memory is accessible by all
processors through an interconnection network in
the same way a single processor accesses its
memory.
All processors take the same time to reach all
memory locations.
The interconnection network used in the UMA can
be a single bus, multiple buses, or a crossbar
switch.
Uniform Memory Access (UMA)
Each processor has equal opportunity to read/write to
memory, including equal access speed.
Commercial examples of SMPs are Sun Microsystems
multiprocessor servers and Silicon Graphics Inc.
multiprocessor servers.
A typical bus-structured SMP computer, as shown below:
Shared Memory Systems…
2. Non-uniform Memory Access (NUMA)
In NUMA system, each processor has part of the
shared memory attached. The memory has a
single address space. Therefore,
Any processor could access any memory
location directly using its real space.
Access time depends upon the location of
processor, this results a non-uniform memory
access time.
Memory access is not uniform.
Non-uniform Memory Access
A number of architectures are used to interconnect
processors to memory modules in a NUMA.
Among these are the tree and the hierarchical bus networks.
Examples of NUMA architecture are BBN TC-2000, SGI
Origin 3000, and Cray T3E.
Figure below shows the NUMA system organization.
Shared Memory Systems…
3. Cache-only memory Architecture (COMA)
Similar to NUMA each processor has a part of the
shared memory in COMA, however, in this case
shared memory consists of cache memory.
3. The code for reading and No such code required here as the
writing the data from the message passing facility provides
shared memory should be mechanism for communication and
written explicitly by the synchronization of actions performed
Application programmer. by the communicating processes.
Shared Memory vs. Message Passing
S. No. Shared Memory System Message Passing System
4. It provides maximum speed of It is time consuming as message
computation as communication passing is implemented through
is done through shared kernel intervention (system calls).
memory so system calls are
made only to establish the
shared memory.
5. Here the processes need to It is useful for sharing small amounts
ensure that they are not writing of data as conflicts need not to be
to the same location resolved.
simultaneously.