A Fair and Spaceefficient Mutual Exclusion - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

A Fair and Spaceefficient Mutual Exclusion

Description:

... with time and memory constraints. A Fair and Space-efficient Algorithm. An Impossibility Result. Our algorithm is space-optimal. ... An Impossibility Result ... – PowerPoint PPT presentation

Number of Views:39
Avg rating:3.0/5.0
Slides: 19
Provided by: che119
Category:

less

Transcript and Presenter's Notes

Title: A Fair and Spaceefficient Mutual Exclusion


1
A Fair and Space-efficient Mutual Exclusion
  • Sheng-Hsiung Chen and Ting-Lu Huang
  • Distributed Computing Lab
  • National Chiao Tung University, Taiwan

2
Outline
  • Introduction
  • The mutual exclusion problem for systems with
    time and memory constraints
  • A Fair and Space-efficient Algorithm
  • An Impossibility Result
  • Our algorithm is space-optimal.
  • Conclusion

3
The Mutual Exclusion Problem
  • The Mutual Exclusion Problem
  • Provide exclusive accesses to a common resource
    among processes.

4
The Mutual Exclusion Problem
  • Each process executes the following four regions
  • Remainder (R) region
  • Trying (T) region (try to gain the
    resource)
  • Critical (C) region (access the
    resource)
  • Exit (E) region (return the
    resource)
  • Correctness Requirements
  • Mutual Exclusion (at most one process in the
    critical region)
  • Progress (deadlock freedom)

5
Systems with Time and Memory Constraints
  • Such as embedded real-time systems
  • Automotive control systems, mobile computing
    devices, home electronics
  • For such systems, a mutual exclusion algorithm
    should take fairness and space-efficiency into
    consideration.

6
Fairness
  • Try to reduce the worst-case waiting time.
  • Bounded Bypass b-bounded bypass for some
    constant b
  • b-bounded bypass a requesting process cannot be
    bypassed by any particular process more than b
    times.
  • A bounded-bypass algorithm can be very useful.
  • A process can roughly estimate the waiting time.
  • For example, in a 2-bounded-bypass algorithm for
    n processes, a process will not be bypassed more
    than 2(n-1) times.

7
Space-efficiency
  • n shared variables are necessary for the
    n-process mutual exclusion if only read/write are
    available (Burns and Lynch, 1993).
  • fetchstore(variable v, value new) is used to
    reduce space consumption.
  • Intel, AMD, Motorola 88000, SPARC, ARM processors
  • atomically reads the value of v and writes new to
    v

8
Related Work
  • Several fair algorithms using only one shared
    variable
  • Fischer et al. 1989, Burns et al. 1982
  • Unfortunately, all of these algorithms used
    hypothetical read-modify-write instructions.

9
Our Algorithm
  • Fair 2-bounded bypass
  • Space-efficient 2 shared variables are used
  • L to organize processes requests
  • P to indicate which process has the permission
    to C region

10
An Informal Description
  • Each process i makes a request by fetchstore(L,
    i).
  • Announce its identity and obtain the identity of
    its predecessor.
  • Requests are organized as lists for instance
  • Then i repeatedly tests P until it has the
  • permission.
  • if i is a head until P nil
  • otherwise until P i
  • Since P nil initially, the first process at
    all
  • will enter C region.

11
An Informal Description
  • After the head leaves C region, it will
  • close the list by fetchstore(L, nil) , and
  • pass the permission to the tail.
  • The permission will be conveyed along
  • the list.
  • If all processes in the list have finished
  • C region, the permission will be conveyed
  • to the next list.

12
An Execution of the Algorithm
13
An Impossibility Result
  • There is no bounded-bypass algorithm with fewer
    than two shared variables by read/write and
    fetchstore.
  • Our algorithm is therefore space-optimal.

14
Covering Argument
  • Introduced by Burns and Lynch, 1993
  • A process covers a shared variable if the process
    enables a write or fetchstore to the variable.
  • The variable will be overwrite.

15
The Main Idea of the Proof (I)
  • B.W.O.C., let A be a bounded-bypass algorithm
    using a single shared variables x.
  • When a process covers x, it will overwrite x.
  • If a request of some process is overwrote, let
    another process enter critical region so many
    times that violate the bounded bypass condition.

16
The Main Idea of the Proof (II)
  • An execution that violates bounded bypass

i in C
i last covers x
i only
s
s
s1
idle state
idle state
j performs a step in T
i writes a value into x
s2
k can enter C many times
17
Conclusion
  • For systems with time and memory constraints, we
    have presented a fair and space-efficient mutual
    exclusion algorithm by fetchstore and read/write
    .
  • By the same set of instructions, it is impossible
    to obtain any algorithm better than ours in
    terms of space complexity.

18
Conclusion
  • By the help of fetchstore, the space requirement
    is reduced from n to 2.
  • Future Work the space requirements for other
    commonly available instructions such as
    compareswap, testset, fetchincrement, etc.
Write a Comment
User Comments (0)
About PowerShow.com