CS6223 Distributed Systems: Tutorial 8 - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

CS6223 Distributed Systems: Tutorial 8

Description:

It is often argued that weak consistency models impose an extra burden for ... In such a consistency model, when a process performs an operation on an ordinary ... – PowerPoint PPT presentation

Number of Views:145
Avg rating:3.0/5.0
Slides: 15
Provided by: george591
Category:

less

Transcript and Presenter's Notes

Title: CS6223 Distributed Systems: Tutorial 8


1
CS6223 Distributed Systems Tutorial 8
  • Q1. Discuss the properties of strict consistency,
    sequential consistency, and weak consistency with
    synchronization variables, and their differences.
  • Q2. In Slide 3, there are four valid execution
    sequences under sequential consistency. However,
    the outputs (results) are different, which result
    is regarded as the correct one? If it is required
    that a unique output (result) is produced, say
    001011 (in (a)), what we should do?

2
Sequential Consistency Examples
  • Four valid execution sequences for the processes.
    The vertical axis is time.

3
CS6223 Distributed Systems Tutorial 8
  • Q3. Explain how replication in DNS takes place,
    and why it actually works so well.
  • Q4. Suppose that there are two processes as
    follows
  • Process P1 Process
    P2
  • a 1 b
    1
  • if (b0) kill (P2) if
    (a0) kill (P1)
  • List all possible statement interleaving that
    are allowed under sequential consistency memory.
  • Q5. It is often argued that weak consistency
    models impose an extra burden for programmers. To
    what extent is this statement actually true?

4
Tutorial 8 Q1 Ans.
  • Q2 Ans.
  • Strict consistency Any read on a data item x
    returns a value corresponding to the result of
    the most recent write on x.
  • The definition implicitly assumes the
    existence of absolute global time, so that the
    determination of most recent is unambiguous.
  • There is no notion of absolute global time in
    DS. It is impossible to implement strict
    consistency in DS.

5
Strict Consistency
  • Behavior of two processes, operating on the same
    data item.
  • (a) A strictly consistent store.
  • (b) A store that is not strictly consistent.

6
Tutorial 8 Q1 Ans.
  • Sequential consistency (Lamport, 1979) A data
    store is said to be sequentially consistent if it
    satisfies the following condition
  • 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 appear in this sequence in the
    order specified by its program.
  • when processes run concurrently, possibly on
    different machines, any interleaving of read and
    write operations is acceptance behavior, but all
    processes should see the same interleaving of
    operations.

7
Sequential Consistency
  • A sequentially consistent data store.
  • A data store that is not sequentially consistent.

8
Tutorial 8 Q1 Ans.
  • Weak consistency models using synchronization
    variables, have the following three properties
  • (1) Accesses to synchronization variables
    associated with a data store are sequentially
    consistent
  • (2) No operation on a synchronization variable
    is allowed to be performed until all previous
    writes have been completed everywhere
  • (3) No read or write operation on data items
    are allowed to be performed until all previous
    operations to synchronization variables have been
    performed.

9
Tutorial 8 Q1 Ans.
  • In such a consistency model, when a process
    performs an operation on an ordinary shared data
    item (e.g., in critical region) no guarantees are
    given about when they will be visible to other
    processes. Only when an explicit synchronization
    takes place, are changes propagated. Weak
    consistency enforces (sequential) consistency on
    a group of operations, using synchronization
    variables as boundaries.

10
Weak Consistency
  • A valid sequence of events for weak consistency.
  • An invalid sequence for weak consistency.

11
Summary of Consistency Models
12
Tutorial 8 Q2
  • Q3 Ans.
  • All four outputs (results) are correct. In
    practice, users are taught to program in such a
    way that exact order of statement execution (in
    interleaving) does not matter. That is, any
    result from a valid interleaving should be
    acceptable. When such an execution order is
    essential, i.e., a unique interleaving is
    required to produce a unique result,
    synchronization operations (or semaphore etc)
    should be used to enforce such an execution.

13
Tutorial 8 Q3 Q4 Ans.
  • Q4 Ans. The basic idea is that name servers cache
    previously looked up results. These results can
    be kept in a cache for a long time, because DNS
    makes the assumption that name-to-address
    mappings do not change often.
  • Q5 Ans. The six statement interleavings are as
    follows
  • (1) a1 if (b0) b1 if (a0)
  • (2) a1 b1 if (a0) if (b0)
  • (3) a1 b1 if (b0) if (a0)
  • (4) b1 if (a0) a1 if (b0)
  • (5) b1 a1 if (b0) if (a0)
  • (6) b1 a1 if (a0) if (b0)

14
Tutorial 8 Q5 Ans.
  • Q6 Ans.
  • It really depends. Many programmers are used
    to protect their shared data through
    synchronization mechanisms such as locks or
    transactions. The main idea is that they require
    a coarser grain of concurrency than one offered
    at the level of only read and write operations.
    However, programmers do expect that operations on
    synchronization variables adhere to sequential
    consistency.
Write a Comment
User Comments (0)
About PowerShow.com