Parallel Processing Unit - 6
Parallel Processing Unit - 6
Introduction
Playing a simple video game on a computer uses audio, images, calculations, rendering, etc.
If a single CPU handles all these things, it will take time to process them. On the other hand,
using multiple CPUs to handle various jobs will work much more smoothly. This process of
executing multiple tasks concurrently is called parallel processing.
Parallel processing is used to enhance the performance of a computer by performing multiple
instructions simultaneously. Unlike sequential processing, parallel architecture can divide a
job into parts and multi-task them. That means concurrent execution of instructions is
possible. Thus, the computational speed of the computer will increase.
One of the significant components of the CPU is ALU (Arithmetic Logic Unit). It is helpful
to execute any instruction on the computer. ALU is divided into several functional units:
All these units will work concurrently and produce the required output.
For Example:
1. The system may have two or more ALUs and can execute multiple instructions simultaneously.
2. The system may have multiple processors operating simultaneously.
3. The following instruction can be fetched while the current instruction is being executed in ALU.
The primary purpose of parallel processing is to increase the computer processing capability
and its throughput. We can achieve parallel processing by using multiple functional units that
can perform identical or different operations concurrently to distribute the data among these
functional units.
With and without parallel processing
o Peer-To-Peer network
o Client/Server network
Peer-To-Peer network
o Peer-To-Peer network is a network in which all the computers are linked together
with equal privilege and responsibilities for processing the data.
o Peer-To-Peer network is useful for small environments, usually up to 10 computers.
o Peer-To-Peer network has no dedicated server.
o Special permissions are assigned to each computer for sharing the resources, but this
can lead to a problem if the computer with the resource is down.
Client/Server Network
o Client/Server network is a network model designed for the end users called clients, to
access the resources such as songs, video, etc. from a central computer known as
Server.
o The central controller is known as a server while all other computers in the network
are called clients.
o A server performs all the major operations such as security and network
management.
o A server is responsible for managing all the resources such as files, directories,
printer, etc.
o All the clients communicate with each other through a server. For example, if client1
wants to send some data to client 2, then it first sends the request to the server for
the permission. The server sends the response to the client 1 to initiate its
communication with the client 2.
Cache Coherence
The cache coherence protocol is discussed in this article as a solution to the
multicache inconsistency issues.
Cache Coherence
A cache coherence issue results from the concurrent operation of several processors
and the possibility that various caches may hold different versions of the identical
memory block. The practice of cache coherence makes sure that alterations in the
contents of associated operands are quickly transmitted across the system.
The cache coherence problem is the issue that arises when several copies of the
same data are kept at various levels of memory.
Cache coherence has three different levels:
o Each writing operation seems to happen instantly.
o Each operand's value changes are seen in every processor in precisely the same
order.
o Non-coherent behavior results from many processors interpreting the same action in
various ways.
Methods to resolve Cache Coherence
The two methods listed below can be used to resolve the cache coherence issue:
o Write Through
o Write Back
Write Through
The easiest and most popular method is to write through. Every memory write
operation updates the main memory. If the word is present in the cache memory at
the requested address, the cache memory is also updated simultaneously with the
main memory.
PauseNext
Unmute
Duration 18:10
Loaded: 57.24%
Fullscreen
The benefit of this approach is that the RAM and cache always hold the same
information. In systems with direct memory access transfer, this quality is crucial. It
makes sure the information in the main memory is up-to-date at all times so that a
device interacting over DNA can access the most recent information.
Write Back
Only the catch location is changed during a write operation in this approach. When
the word is withdrawn from the cache, the place is flagged, so it is replicated in the
main memory. The right-back approach was developed because words may be
updated numerous times while they are in the cache. However, as long as they are
still there, it doesn't matter whether the copy that is stored in the main memory is
outdated because requests for words are fulfilled from the cache.
An accurate copy must only be transferred back to the main memory when the word
is separated from the cache. According to the analytical findings, between 10% and
30% of all memory references in a normal program are written into memory.
The important terms related to the data or information stored in the cache as well as
in the main memory are as follows:
o Modified - The modified term signifies that the data stored in the cache and main
memory are different. This means the data in the cache has been modified, and the
changes need to be reflected in the main memory.
o Exclusive - The exclusive term signifies that the data is clean, i.e., the cache and the
main memory hold identical data.
o Shared - Shared refers to the fact that the cache value contains the most current data
copy, which is then shared across the whole cache as well as main memory.
o Owned - The owned term indicates that the block is currently held by the cache and
that it has acquired ownership of it, i.e., complete privileges to that specific block.
o Invalid - When a cache block is marked as invalid, it means that it needs to be
fetched from another cache or main memory.
1. MSI Protocol
This is a fundamental cache coherence mechanism that is utilized in multiprocessor
systems. A cache may be in any state indicated by the protocol name's letters.
Therefore, for MSI, each block may be in one of the following states:
o Modified - In other words, the data in the cache is incompatible with the main
memory, and this status denotes that the block has been updated in the cache.
Therefore, when the data from the cache block is removed and is in the Modified (M)
state, the cache is responsible for writing the block to the main memory.
o Shared - At least one cache has at least one copy of this block, which has not been
updated. The cache might be removed without writing the data to the backup store.
o Invalid - If this block is going to be stored in this cache, it must be obtained from
RAM or from a different cache because it is invalid.
2. MOSI Protocol
It has one extra state than the MSI protocol, which is discussed below:
Owned - It is used to signify the ownership of the current processor to this block and
will respond to inquiries if another processor wants this block.
3. MESI Protocol
The protocol for cache coherence that is utilized the most is this one. Each cache line
bears a status indicating one of the following:
o Modified - As mentioned above, this term signifies that the data stored in the cache
and main memory are different. This means the data in the cache has been modified,
and the changes need to be reflected in the main memory.
o Exclusive - The exclusive term signifies that the data is clean, i.e., the cache and the
main memory hold identical data.
o Shared - This signifies that other caches on the computer may also hold this cache
line.
o Invalid - This indicates that this cache line is marked as invalid by the word "invalid."
4. MOESI Protocol
This protocol provides comprehensive cache coherence, covering all potential states
that are frequently utilized in other protocols. There are one of the following statuses
for each cache line:
o Modified - While the copy in main memory is inaccurate and no other processors are
holding copies, a cache line in this condition contains the most recent, accurate copy
of the data.
o Owned - The most current, accurate copy of the data is stored in a cache line in this
state. In that other processors can store copies of the most recent, accurate data
comparable to the shared state; unlike the shared state, copies in main memory can
be inaccurate. One processor can only own the data at a time, and the remaining
processor can have the data in the shared state.
o Exclusive - The most current, accurate copy of the data is stored on a cache line in
this state. Since no other storage location has a copy of the data, the ram copy is also
the most recent and accurate copy.
o Shared - The most current, accurate copy of the data is stored on a cache line in this
condition. Additional system processors may also store data copies in the shared
state. If no other processor has ownership of the data, the copy in primary memory
also represents the most recent and accurate version of the data.
o Invalid - In this situation, a cache line doesn't contain a reliable copy of the data.
Still, valid data can be found in primary memory or another processor's cache.
Types of Coherence:
There exist three varieties of coherence referred to the coherency mechanisms, which
are listed below: