Вы находитесь на странице: 1из 21

Unit –III

Introduction to DSM
ESSAY QUESTIONS
1. What is meant by DSM and explain the design and implementation of DSM Systems?

1) The distributed shared memory (DSM) implements the shared memory model in
distributed systems, which have no physical shared memory.
2) The shared memory model provides a virtual address space shared between all nodes.
The overcome the high cost of communication in distributed systems, DSM systems move
data to the location of access DSM also known as DSVM.
DSM provides a virtual address space shared among processes on loosely coupled processors.
DSM is basically an abstraction that integrates the local memory of different machine into a
single logical entity.
1) Shared by cooperating processes.
2) Each node of the system consists of one or more CUPs and memory unit.
3) Nodes are connected by high speed communication network.
4) Simple message passing system for nodes to exchange information.
5) Main memory of individual nodes is used to cache pieces of shared memory space.
6) Memory mapping manager routine maps local memory to shared virtual memory.
7) Shared memory of DSM exist only virtually.
8) Shared memory space is partitioned into blocks.
9) Data caching is used in DSM system to reduce network latency.
10) The basic unit of caching is a memory block.

11) The missing block is migrate from the remote node to the client process’s node and
operating system maps into the application’s address space.
12)
13) Data block keep migrating from one node to another on demand but no communication
is visible to the user processes.

14) If data is not available in local memory network block fault is generated.
2. Explain the Granularity?
Most visible parameter in the design of DSM system is block size.
Factors influencing block size selection: Sending large packet of data is not much more
expensive than sending small ones.
Paging overhead: A process is likely to access a largeregion of its shared address space in a
small amount of time.
Therefore the paging overhead is less for large block sizeas compared to the paging
overhead for small block size.
Directory size: the larger the block size, the smaller the directory.
Ultimately result in reduced directory management overhead for larger block size.
Thrashing: The problem of thrashing may occur when data item in the same data block are
being updated by multiple node at the same time.
Problem may occur with any block size, it is more likely with larger block size.

False sharing:

Process P1 P
accesses data in 1
this area

Process P1 P
accesses data in
this area 2
A data block
Fig: False Sharing

Occur when two different processes access two unrelated variable that reside in the same
data block. The larger is the block size the higher is the probability of false sharing. False sharing of
a block may lead to a thrashing problem.
Using page size as block size: Relative advantage and disadvantages of small and
largeblock size make it difficult for DSM designer to decide on a proper block size.
Following advantage: It allows the use of existing page fault schemes to trigger a DSM page
fault.
It allows the access right controlpage size do not impose undue communication overhead at
the time of network page fault. Page size is a suitable data entity unit with respect to memory
contention.

3. Explain the Consistency Model?


 A consistency model is contract between a distributed data store and processes, in which
the processes agree to obey certain rules in contrast the store promises to work correctly.
 A consistency model basically refers to the degree of consistency that should be maintained
for the shared memory data.
 If a system supports the stronger consistency model, then the weaker consistency model is
automatically supported but the converse is not true.

 The types of consistency models are Data – Centric and client centric consistency models.
1. Data – Centric Consistency Models:
A data store may be physically distributed across multiple machines. Each process that can
access data from the store is assumed to have a local or nearby copy available of the entire
store.
i. Strict Consistency Model:
1) Any read on data item X returns a value corresponding to the result of the most
recent write on X
2) This is the strongest form of memory coherence which has the most stringent
consistency requirement.

3) Strict consistency is the ideal model but it is impossible to implement in a


distributed system. It is based on absolute global time or a global agreement on
commitment of changes.
ii. Sequential Consistency:
1) Sequential consistency is an important data – centric consistency model which is
a slightly weaker consistency model than strict consistency.
2) A data store is said to be sequentially consistent if the result of any execution is
the same as if the (read and write) operations by all processes on the data store
were executed in some sequential order and the operations of each individual
process should appear in this sequence in a specified order.

Example: Assume three operations read (R1), write (W1), read (R2) performed in an order
on a memory address. Then (R1, W1, R2), (R1, R2, W1), (W1, R1, R2) (R2, W1, R1) are acceptable
provided all processes see the same ordering.
iii. Linearizability:
1) It that is weaker than strict consistency, but stronger than sequential
consistency.
2) A data store is said to be linerarizable when each operation is timestamped and
the result of any execution is the same as if the (read and write) operations by
all processes on the data store were executed in some sequential order.
3) The operations of each individual process appear in sequence order of each
individual process appear in sequence in some sequential order specified by its
program.

4) If tsOP1(x)< tsOP2(y), then operation OP1(x) should precede OP2(y) in this


sequence.
iv. Causal Consistency:
1) It is a weaker model than sequential consistency.
2) In Casual Consistency all processes see only those memory reference operations
in the correct order that are potentially causally related.
3) Memory reference operations which are not related may be seen by different
processes in different order.
4) A memory reference operation is said to be casually related to another memory
reference operation if the first operation is influenced by the second operation.

5) If a write (w2) operation is casually related to another write (w1) the acceptable
order is (w1, w2).
v. FIFO Consistency:
1) It is weaker than causal consistency.
2) This model ensures that all write operations performed by a single process are
seen by all other processes in the order in which they were performed like a
single process in a pipeline.
3) This model is simple and easy to implement having good performance because
processes are ready in the pipeline.

4) Implementation is done by sequencing write operations performed at each node


independently of the operations performed on other nodes.
Example: If (w11) and (w12) are write operations performed by p1 in the order and (w21),
(w22) by p2. A process p3 can see them as [(w11, w12), (w21, w2)] while p4 can view them as
[(w21, w2), (w11, w12)].
vi. Weak consistency:
1) The basic idea behind the weak consistency model is enforcing consistency on a
group of memory reference operations rather than individual operations.
2) A Distributed Shared Memory system that supports the weak consistency model
uses a special variable called a synchronization variable which is used to
synchronize memory.

3) When a process accesses a synchronization variable, the entire memory is


synchronized by making visible the changes made to the memory to all other
processes.
vii. Release Consistency:
1) Release consistency model tells whether a process is entering or exiting from a
critical section so that the system performs either of the operations when a
synchronization variable is accessed by a process.
2) Two synchronization variables acquire and release are used instead of single
synchronization variable. Acquire is used when process enters critical section
and release is when it exits a critical section.

3) Release consistency can be viewed as synchronization mechanism based on


barriers instead of critical sections.
viii. Entry Consistency:
1) In entry consistency every shared data item is associated with a synchronization
variable.
2) In order to access consistent data, each synchronization variable must be
explicitly acquired.

3) Release consistency affects all shared data but entry consistency affects only
those shared data associated with a synchronization variable.
2. Client – Centric Consistency Models:
1) Client – Centric Consistency models aim at providing a system wide view on a data
store.
2) This model concentrates on consistency from the perspective of a single mobile
client.

3) Client – Centric Consistency models are generally used for applications that lack
simultaneous updates were most operations involve reading data.
a) Eventual Consistency:
1) In Systems that tolerate high degree of inconsistency, if no updates take place
for a long time all replicas will gradually and eventually become consistent. This
form of consistency is called eventual consistency.
2) Eventual consistency only requires those updates that guarantee propagation to
all replicas.
3) Eventual consistent data stores work fine as long as clients always access the
same replica.

4) Write conflicts are often relatively easy to solve when assuming that only a small
group of processes can perform updates. Eventual consistency is therefore often
cheap to implement.
b) Monotonic Reads Consistency:

1) A data store is said to provide monotonic – read consistency if a process reads


the value of a data item x, any successive read operation on x by that process
will always return that same value or a more recent value.
2) A process has seen a value of x at time t, it will never seen an older version of x
at a later time.
Example: A user can read incoming mail while moving. Each time the user connects to a
different e-mail server that server fetches all the updates from the server that the user previously
visited. Monotonic Reads guarantees that the user sees all updates, no matter from which server the
automatic reading takes place.
c) Monotonic Writes:
1) A data store is said to be monotonic write consistent if a write operation by a
process on a data item x is completed before any successive write operation on
X by the same process.
2) A write operation on a copy of data item x is performed only if that copy has
been brought up to date by means of any preceding write operations, which may
have taken place on other copies of x.
Example: Monotonic – write consistency guarantees that if an update is performed on a
copy of Server S, all preceding updates will be performed first. The resulting server will then indeed
become the most recent version and will include all updates that have led to previous versions of
the server.
d) Read Your Writes:
1) A data store is said to provide read – your – writes consistency if the effect of a
write operation by a process on data item x will always be a successive read
operation on x by the same process.
2) A write operation is always completed before a successive read operation by the
same process no matter where that read operation takes place.
Example: Updating a Web page and guaranteeing that the Web browser shows the newest
version instead of its cached copy.
e) Writes Follow Reads:
1) A data store is said to provide writes – follows – reads consistency if a process
has write operation on a data item x following a previous read operation on x
then it is guaranteed to take place on the same or a more recent value of x that
was read.
2) Any successive write operation by a process on a data item x will be performed
on a copy of x that is up to date with the value most recently read by that
process.
Example: Suppose a user first reads an article A then posts a response B. by requiring
writes – follows – reads consistency, B will be written to any copy only after A has been written.`

4. Explain the Clock Synchronization?

As in non-distributed systems, the knowledge of when events occur is necessary. However,


clock synchronization is often more difficult in distributed systems because there is no ideal time
source, and because distributed algorithms must sometimes be used. Distributed algorithms must
overcome: Scattering of information Local, rather than global, decisionmaking

a) Physical Clocks: The time difference between two computers is known as drift.
Clock drift over time is known as skew. Computer clock manufacturers specify a
maximum skew rate in their products.

Computer clocks are among the least accurate modern timepieces. Inside every computer is a chip
surrounding a quartz crystal oscillator to record time. These crystals cost 25 seconds to produce.

Average loss of accuracy: 0.86 seconds per day.


This skew is unacceptable for distributed systems. Several methods are now in use to attempt the
synchronization of physical clocks in distributed systems:

Physical Clocks – UTC: Coordinated Universal Time (UTC) is the international time standard. UTC
is the current term for what was commonly referred to as Greenwich Mean Time (GMT). Zero hours
UTC is midnight in Greenwich, England which lies on the zero longitudinal meridians. UTC is based
on a 24-hour clock.
(i) Physical Clocks – Christian’s Algorithm:
Assuming there is one time server with UTC:Each node in the distributed system
periodically polls the time server.
Time (T1) is estimated as Stime + (T1 – T0)/2
This process is repeated several times and an average is provided.
Machine T1 then attempts to adjust its time.
Disadvantages: Must attempt to take delay between server T1 and time server into account Single
point of failure if time server fails.

(ii) Physical Clocks – Berkeley Algorithm:


One daemon without UTC:Periodically, the daemon polls all machines on the distributed
system for their times.
The machines answer.
The daemon computes an average time and broadcasts it to the machines so they can adjust.

(iii) Physical Clocks – Decentralized Averaging Algorithm:


Each machine on the distributed system has a daemon without UTC.
Periodically, at an agreed – upon fixed time, each machine broadcasts its local time.
Each machine calculates the correct time by averaging all results.

(iv) Physical Clocks – Network Time Protocol (NTP):

Enables clients across the Internet to be synchronized accurately to UTC. Overcomes large
and variable message delays.
Employs statistical techniques for filtering, based on past quality of servers and several
other measures.
Can survive lengthy losses of connectivity: Redundant servers. Redundant paths to servers.
Provides protection against malicious interference through authentication techniques.
Uses a hierarchy of servers located across the Internet. Primary servers are directly connected to a
UTC time source.

Hierarchy in NTP
(UTC)
Most accurate 1

1 1

Less accurate 1 1 1

Fig: Hierarchy in NTP

NTP has three modes: Multicast Mode:Suitable for user workstations on a LAN. One or more
servers periodically mutlicasts the time to other machines on the network. Procedure Call
Mode:Similar to Christian’s algorithm. Provides higher accuracy than Multicast Mode because
delays are compensated for

Symmetric Mode: Pairs of servers exchange pairs of timing messages that contain time
stamps of recent message events. The most accurate, but also the most expensive mode.
(b) Logical Clocks: Often, it is not necessary for a computer to know the exact time, only
relative time. This is known as “logical time”.
Logical time is not based on timing but on the ordering of events. Logical clocks can only
advance forward, not in reverse. Non – interacting processes cannot share a logical clock.
Computers generally obtain logical time using interrupts to update a software clock. The
more interrupts (the more frequently time is updated), the higher the overhead.
(i) Logical Clocks – Lamport’s Logical Clock Synchronization Algorithm:
The most common logical clock synchronization algorithm for distributed systems is
Lamport’s Algorithm. It is used in situations where ordering is important but global time is not
required.
Basedon the “happens – before” relation: Event A “happens – before” Event when all
processes involved in a distributed system agree that event A occurred first, and B subsequently
occurred.
This DOES NOT mean that Event A actually occurred before Event B in absolute clock time.
A distributed system can use the “happens – before” relation when: Events A and B are observed by
the same process, or by multiple processes with the same global clock.
Event A acknowledges sending a message and Event B acknowledges receiving it, since a
message cannot be received before it is sent. If two events do not communicate via messages, they
are concurrent because order cannot be determined and it does not matter. Concurrent events can
be ignored.

(ii) Logical Clocks – Lamport’s Logical Clock Synchronization Algorithm (cont.):


In the previous examples, Clock (C)A<(C)B
If they are concurrent, (C)A=(C)B
Concurrent events can only occur on the same system, because every message transfer
between two systems takes at least one clock tick.
In Lamport’s Algorithm, logical clock values for events may be changed but always by
moving the clock forward. Time values can never be decreased.
An additional refinement in the algorithm is often used: if Event A and Event B are
concurrent. (C)A = (C)B, some unique property of the processes associated with these events can be
used to choose a winner. This establishes a total ordering of all events.
Process ID is often used as the tiebreaker.
Lamport’s Algorithm can thus be used in distributed systems to ensure synchronization: A
logical clock is implemented in each node in the system.
Each node can determine the order in which events have occurred in that system’s own
point of view.
The logical clock of one node does not need to have any relation to real time or to any other
node in the system.

5. Discuss the Event Ordering?


Coordination of requests (especially in a fair way) requires events (requests) to be ordered.
Stand – alone systems:
1. Shared Clock / Memory.
2. Use a time – stamp to determine ordering.
Distributed Systems
1. No global clock.
2. Each clock runs at different speeds.
How do we order events running on physically separated systems?
Messages (the only mechanism for communicating between systems) can only be received after
they have been sent.
Event Ordering: Happened Before Relation
If A and B are events in the same process, and A executed before B, then AB.
If A, is a message sent and B is when the message is received, then AB.
AB, and BC, then AC
Q
q0
q1
q2
q3
q4
q5
P0
P1
P2
P3
P4

me
rR
rrTi3120
ge
ssa
P
Me

Ordered events  Unordered (Concurrent) events


 p1 precedes ______  q0 is concurrent with ________
 q4 precedes ______  q2 is concurrent with ________
 q2 precedes _____  q4 is concurrent with ________
 p0 precedes ______  q5 is concurrent with ________

Define a notion of event ordering such that:


1. If AB, then A precedes B.
2. If A and B are concurrent events, then nothing can be said about ordering of A and B.
Solution:
1. Each processor I maintains a logical clock LCi
2. When an event occurs locally, ++ LCi
3. When processor X sends a message to Y, it also sends LC x in the message.
4. When Y receives this message it:
If LCy < (LCx +1) LCy = LCx +1;
Note: If “time” of A precedes “time” of B, then???
If A -> B and C-> B does A-> C?
Yes or No

6. Explain the Mutual exclusion?


Every node in the system keeps a request queue sorted by logical time stamp. Logical clocks
are used to impose total global order on all events.
Ordered message delivery between every pair of communicating sites is assumed. Messages
sent form Site Si arrive at Site Sj in the same order.
Site Si sends a request and places the request in the local request queue.
2. When Site Sj receives the request, it sends a time – stamped reply to Site Si and places the
request in its local request queue.
3. Site Si gains the critical section of the requested data when it has received a message from
all other sites with a timestamp larger than the request.
(i) Centralized Algorithm: The most simple and straights forward way to achieve to
mutual exclusion in a distributed system is to simulate how it is done in a one – processor system:
one process is elected as the coordinator.
When any process wants to enter a critical section, it sends a request message to the
coordinator stating which critical section it wants to access.
If no other process is currently in that critical section, the coordinator sends back a reply
granting permission. When the reply arrives, the requesting process enters the critical section. If
another process requests access to the same critical section, it is ignored or blocked until the first
process exits the critical section and sends a message to the coordinator stating that it has exited.
The Centralized Algorithm does have disadvantages: The coordinator is a single point of
failure. If processes are normally ignored when requesting a critical section that is in use, they
cannot distinguish between a dead coordinator and “permission denied”. In a large system, a single
coordinator can be a bottleneck.

0 1 2 0 1 2 0 1 2
Request Ok Request Release
Ok
No reply

3 Queue is
3 2 3
empty

Coordinator
(a) (b) (c)

(ii) Distributed Algorithms: It is often unacceptable to have a single point of failure.


Therefore researchers continue to look for distributed mutual exclusion algorithms. The most well-
known is by Ricart and Agrawala: There must be a total ordering of all events in the system.
Lamport’s Algorithm can be used for this purpose.

When a process wants to enter a critical section, it builds a message containing the name of
the critical section, its process number and the current time. It then sends the message to all other
processes, as well as to itself.

When a process receives a request message, the action it takes depends on its state with
respect to the critical section named in the message. There are three cases: if the receiver is not in
the critical section and does not want to enter it, it sends an ok message to the sender.

If the receiver is in the critical section, it does not reply. It instead queues the request.
If the receiver also wants to enter the same critical section, it compares the time stamp in
the incoming message with the time stamp in the message it has sent out. The lowest time stamp
wins. If its own message has a lower time stamp it does not reply and queues the request from the
sending process.

When a process has received OK messages from all other processes, it enters the critical
section. Upon exiting the critical section, it sends OK messages to all processes in its queue and
deletes them all from the queue.

(iii) Token – Based Algorithms: Another approach is to create a logical or physical ring.

Each process knows the identity of the process succeeding it. When the ring is initialized,
process 0 is give a token. The token circulates around the ring in order, from process k to process
k+1.

When a process receives the token from its neighbor, it checks to see if it is attempting to
enter a critical section. If so, the process enters the critical section and does its work, keeping the
token the whole time.

After the process exits the critical section, it passes the token to the next process in the ring.
It is not permitted to enter a second critical section using the same token.

If a process is handed a token an is not interested in entering a critical section, it passes the
token to the next process.

1
2
3
7
8
5
4
6

0 2 4 8 7 1 6 5 8 3

(a)

7. Define the Deadlock and explain the Deadlock? (b)


A deadlock occurs when a set of processes in a system are blocked waiting for requests that can
never be satisfied.
Approaches:
1. Detection (& Recovery).
2. Prevention.

3. Avoidance – not practical in distributed setting.


Difficulties:
1. Resource allocation information is distributed.
2. Gathering information requires messages. Since messages have non – zero delays, it is
difficult to have an accurate and current view of resource allocation.
Suppose following information is available:
1. For each process, the resources it currently holds.

2. For each process, the request that it is waiting for then, one can check if the current system
state is deadlocked, or not.
In single – processor systems, OS can maintain this information, and periodically execute
deadlock detection algorithm.
What to do if a deadlock is detected:
1. Kill a process involved in the deadlocked set
2. Inform the users, etc.

a) Wait For Graph (WFG):


Definition: A resource graph is a bipartite directed graph (N,E), where
1. N = P U R,
2. P = {p1, …..pn}, R = {r1, ……rn}
3. (r1, ….rn) available unit vector.
4. An edge (pi, rj) a request edge, and

5. An edge (ri, pj) an allocation edge.


Definition: Wait For Graph (WFG) is a directed graph, where nodes are processes and a directed
edge from P -> Q represents that P is blocked waiting for Q to release a resource.
So, there is an edge from process P to process Q if P needs a resource currently held by Q.
(i) Deadlock Detection Algorithms:
Centralized Deadlock Detection, false deadlock.

1. Initial resource graph for machine 0.


2. Initial resource graph for machine 1
3. The coordinator’s view of the world.

4. The situation after the delayed message.


(ii) Wait – for Graph for Detection:
1. Assume only one instance of each resource.

2. Nodes are processes.


Recall Resource Allocation Graph: It had nodes for resources as well as processes (basically same
idea)
3. Edges represent waiting: If P is waiting to acquire a resource that is currently held by Q,
then there is an edge from P to Q.
4. A deadlock exists if and only if the global wait – for graph has a cycle
5. Each process maintains a local wait – for graph based on the information it has

6. Global wait – for graph can be obtained by the union of the edges in all the local copies
(iii) Deadlock Prevention:
1. Hierarchical ordering of resources avoids cycles
2. Time – stamp ordering approach:

Prevent the circular waiting condition by preempting resources if necessary.


a) The basic idea is to assign a unique priority to each process and use these priorities
to decide whether process P should wait for process Q.
b) Let P wait for Q if P has a higher priority than Q: Otherwise, P is rolled back.

c) This prevents deadlocks since for every edge (P,Q)in the wait – for graph, P has a
higher priority than Q. Thus a cycle cannot exist.

8. Explain the Election Algorithm?


Election Algorithms:
The coordinator election problem is to choose a process from among a group of processes
on different processors in a distributed system to act as the central coordinator.
An election algorithm is an algorithm for solving the coordinator election problem. By the
nature of the coordinator election problem any election algorithm must be a distributed algorithm.
(i) A group of processes on different machines need to choose a coordinator.
(ii) Peer to peer communication: every process can send messages to every other process.
(iii) Assume that processes have unique IDs, such that one is highes.
(iv) Assume that the priority of process Pi is i

(a) Bully Algorithm:


Background: Any process Pi send a message to the current coordinator; if no response in T
time units, Pi tries to elect itself as leader. Details follow:
Algorithm for process Pi that detected the lack of coordinator
1. Process Pi sends as “Election” message to every process with higher priority.
2. If no other process responds, process Pi starts the coordinator code running and
sends a message to all processes with lower priorities saying “Elected P i”

3. Else, Pi waits for T’ time units to hear from the new coordinator, and if there is no
response start from step (1) again.
Algorithm for other processes (also called Pi)
If Pi is not the coordinator then Pi may receive either of these messages from Pj
If Pi sends “Elected Pj”; [this message is only received if i<j]
Pi updates its records to say that Pj is the coordinator.
Else if Pj sends “election” message (i>j)

Pi sends a response to Pj saying it is alive


Pi starts an election.

(b) Election in A Ring => Ring Algorithm:


Assume that processes form a ring: each process only sends messages to the next process in
the ring.
Active list: Its info on all other active processes.
Assumption: message continues around the ring even if a process along the way has crashed.
Background: Any process Pi sends a message to the current coordinator; if no response in T time
units, Pi initiates an election.
1. Initialize active list to empty.
2. Send an “Elect (i)” message to the right + add I to active list. If a process receives an
“Elect(j)” message.
(a) This is the first message sent or seen.
Initialize its active list to [I,j]; send “Elect (i)” + send “Elect(j)”
(b) if I !=j, add I to active list + forward “Elect(j)” message to active list.
(c) otherwise (i=j), so process I has complete set of active processes in its active list.
=> choose highest process ID + send “Elected (x)” message to neighbor
If a process receives “Elected (x)” message,
Set coordinator to x
Example:
Suppose that we have four processes arranged in a ring: P1? P2 ? P3 ? P4 ? P1 ……….
P4 is coordinator
Suppose P1 + P4 crash
Suppose P2 detects that coordinator P4 is not responding P2 sets active list to [ ]
P2 sends “Elect (2)” message to P3; P2 sets active list to [2]
P3 receives “Elect(2)”
This message is the first message seen, so P3 sets its active list to [2, 3].
B (AB) P3 sends “Elect(3)” towards P4 and then sends “Elect(2)” towards P4
The messages pass P4 + P1 and then reach P2
P2 adds 3 to active list [2, 3]
P2 forwards “Elect(3) to P3
P2 receives the “Elect(2) message
P2 chooses P3 as the highest process in its list [2, 3] and sends an “Elected (P3)” message
P3 receives the “Elect(3)” message.
P3 chooses P3 as the highest process in its list [2, 3] + sends an “Elected(P3)” message.
Byzantine Generals Problem:
Intuition: Only want to proceed with the plan of attack if they are sure everyone else agrees
Can’t trust other generals.
If generals can’t trust one another they can never be sure if they should attack.

SHORT ANSWER QUESTIONS

1. What is meant by Wireless Elections?


If more than one election is called (multiple source nodes), a node should participate in only one.
1) Election messages are tagged with a process id.
2) If a node has chosen a parent but gets an election message from a higher numbered node, it
drops out of the current election and adopts the high numbered node as its parent.

2. Discuss the Read – Replication Algorithm?


Replicates data objects to multiple nodes. DSM keeps track of location of data objects.
Multiple nodes can have read access or one node write access (multiple readers – one writer
protocol). After a writer, all copies are invalidated or updated

DSM has to keep track of locations of all copies of data objects. Examples of
implementations:
1. IVY: Owner node of data object knows all nodes that have copies.
2. PLUS: Distributed linked – list tracks all nodes that have copies.
Advantage: The read – replication can lead to substantial performance improvements if the ratio of
reads to writes is large.

3. What is the difference between message passing and DSM?


DSM Message Passing
Variables are shared directly Variables have to be marshaled yourself.
Processes can cause error to one another by Processes are protected from one another by
altering data. having private address spaces.
Processes may execute with non – overlapping Processes must execute at the same time.
lifetimes.
Invisibility of communication’s cost Cost of communication is obvious.

4. What is meant by Memory Consistency?


To use DSM, one must also implement a distributed synchronization service. This includes
the use of locks, semaphores and message passing.
Most implementations, data is read from local copies of the data but updates to data must
be propagated to other copies of the data.
Memory consistency models determine when data updates are propagated and what level
of inconsistency is acceptable.

5. What is meant by Trashing?


Thrashing occurs when network resources are exhausted, and more time is spent
invalidating data and sending updates than is used doing actual work. Based on system specifics,
one should choose write – update or write – invalidate to avoid thrashing.
6. Discuss the Issues of DSM?
(a) Granularity:
1. Granularity refers to the block size of DSM
2. The unit of sharing and the unit of data transfer across the network when a network
block fault occurs
3. Possible unit are a few word, a page or a few pages
(b) Structure of Shared memory:
1. Structure refers to the layout of the shared data in memory
2. Dependent on the type of applications that the DSM system is intended to support.
Memory coherence and access synchronization:
In a DSM system that allows replications that allows replication of shared data item, copies
of shared data item may simultaneously be available in the main memories of a number of nodes.
To solve the memory coherence problem that dealwith the consistency of a piece of shared
data lying in the main memories of two or more nodes.
Data location and access: To share data in a DSM, should be possible to locate andretrieve
the data accessed by a user process.
Replacement strategy: If the local memory of a node is full, a cache miss at thatnode
implies not only a fetch of accessed data block from a remote node but also a replacement.
Data block must be replaced by the new data block.
Thrashing: Data block migrate between nodes on demand. Therefore if two nodes compete
for write access to a single data item the corresponding data block may be transferred back.
Heterogeneity: The DSM system built for homogeneous system need notaddress the
heterogeneity issue.

7. What are the Advantages of DSM?


1. Data sharing is implicit, hiding data movement (as opposed to ‘Send/Receive’ in
message passing model).
2. Passing data structures containing pointers is easier (in message passing model data
moves between different address spaces).
3. Moving entire object to user takes advantage of locality difference.
4. Less expensive to build than tightly coupled multiprocessor system: off – the – shelf
hardware, no expensive interface to shared physical memory.
5. Very large total physical memory for all nodes: Large programs can run more efficiently.
6. No serial access to common bus for shared physical memory like in multiprocessor
systems.
7. Programs written for shared memory multiprocessors can be run on DSM systems with
minimum changes.

1.

Вам также может понравиться