Asynchronous Communication Mechanisms (ACMs) Fei Xia Fei Xia - - PowerPoint PPT Presentation

asynchronous communication mechanisms acms
SMART_READER_LITE
LIVE PREVIEW

Asynchronous Communication Mechanisms (ACMs) Fei Xia Fei Xia - - PowerPoint PPT Presentation

Asynchronous Communication Mechanisms (ACMs) Fei Xia Fei Xia EECE, Newcastle University


slide-1
SLIDE 1

Asynchronous Communication Mechanisms (ACMs)

Fei Xia Fei Xia EECE, Newcastle University

slide-2
SLIDE 2
  • Point to point connection

writer reader data writer reader Data is a stream of items of a set type. Writer and reader are cyclic processes. Writer provides one item of data per cycle. Reader uses one item per cycle.

slide-3
SLIDE 3
  • Simple approach

reader writer

t

b a

slide-4
SLIDE 4
  • An ACM divides temporal domains

writer timing domain reader timing domain writer reader ACM temporal divide

slide-5
SLIDE 5
  • Each process updates its
  • wn control variables
  • A process can only read the

value of a control variable of another process

  • Concurrent processes

ACM reader writer

Shared memory Control variables

data data

  • The shared memory is organized

as a set of cells

  • A cell is a memory location that

can store one data item

  • Each process has its own set of

control variables

  • Concurrent processes

executing on different timing domains

  • 1-bit control variables
  • Does not require any

synchronization primitives

  • Order of execution does

not interfere on the correctness of the result

data data

slide-6
SLIDE 6
  • Atomic register [Lamport 86]
  • The problem of asynchronous communication can be solved using

shared registers

  • Complex registers are built from simple ones
  • ACMs [Simpson 87-03]
  • Defined a fully ACM that preserves data-coherence with 4 slots
  • Defined a fully ACM that preserves data-coherence with 4 slots
  • Classification of ACMs
  • Systematic synthesis of ACMs [Yakovlev Group 96-08]
  • ACMs are modelled using MATLAB for use in higher level systems
  • Automatic synthesis of ACMs [Gorgônio, Xia 05-08]
  • State space generation (BFS based)
  • Petri net synthesis using theory of regions
  • Modular approach using Petri nets modules as building blocks
  • Modelling and verification using CPN
slide-7
SLIDE 7
  • BB

BB RRBB RRBB ! ! OWBB OWBB OWRRBB OWRRBB ! ! OWBB OWBB OWRRBB OWRRBB

  • Overwriting enables the writer to be fully asynchronous
  • Rereading enables the reader to be fully asynchronous
  • BB stands for bounded buffer
slide-8
SLIDE 8
  • ACM

Reader Writer Control variables Shared memory data data variables enough memory to enough memory to contain an arbitrary contain an arbitrary number of items number of items

slide-9
SLIDE 9

"

C C0 C C1

1

C C

  • 1

1

C C2

2

  • cells in a ring … …

cells in a ring … …

slide-10
SLIDE 10

#$

  • RRBB with three cells from an interleaving specification
  • rereading

cyclic waiting

slide-11
SLIDE 11

""

  • Adding “silent actions”

µ µ

  • λ
  • λ

µ µ

  • λ: writer silent actions;

µ: reader silent actions

µ

  • µ

µ

  • λ

µ

  • λ

λ

  • µ

µ

  • µ

µ

  • λ
  • prepare to

reread

slide-12
SLIDE 12

""

µ µ

  • λ
  • λ

µ µ

  • var : 0..-1; : 0..-1; initialized sensibly

(say =-1) and initialize data items in the cells. writer wr: write cell ; ww: wait until ≠+1; w0: :=(+1 mod ); reader r0: if (+1 mod )≠ then :=(+1 mod ); rd: read cell ;

µ

  • λ
  • µ

µ

  • λ

µ

  • λ

λ

  • µ

µ

  • µ

µ

  • λ
  • w0: :=(+1 mod );

rd: read cell ;

slide-13
SLIDE 13

""

Reader Writer cell memory and ACM cell cell memory data data cell memory and ACM cell +1 Reader Writer data data advance advance

slide-14
SLIDE 14
  • var : 0..1; : 0..1; initialized sensibly (one cell has =1 and

another has =1, all others being 0) and initialize data in the cells. %

  • %
  • wr: write;

r0: if next=0 then w0: :=0; next:=1; begin :=0; next:=1; ww: wait until next=0; advance to next end wa: advance to next; rd: read;

slide-15
SLIDE 15

!

  • Needs more than one “slot” per cell
  • This will allow the writer to “overtake” the reader if overwriting the oldest

item in the buffer

  • Item to be overwritten can be
  • Oldest in the buffer
  • Newest in the buffer
  • Newest in the buffer
  • Some other item (does not make as much sense as the previous choices)
  • Also has to do with if the ACM is organized as a FIFO, a stack or a random

bag

slide-16
SLIDE 16

&!%""

µ µ µ

  • λ
  • µ
  • λ
  • λ
  • µ
  • µ

µ

  • λ
  • µ

µ λ µ

  • λ
  • λ

λ µ µ

  • µ

µ λ λ

slide-17
SLIDE 17

&!%""

writer writer

Control variables

x x x

slot 0 cell 0 cell 1 cell 2

reader reader

One-hot enconding (1-bit variable)

Control variables data

x00 x10 x20

slot 0 slot 1

x01

slide-18
SLIDE 18

!%""

var : 0..1; : 0..1; : 0..1 (this cell is overwritten); : 0..1 (writer releases cell for reader); %

  • w0: next:=0;

r0: if =1 then w0: next:=0; r0: if =1 then if ≠ then :=1; begin :=0; =(not); advance to next end wr: write slot ; :=; wa: :=1; rd: read slot ; next:=0; ra: if next=1 then advance to next; advance to next

slide-19
SLIDE 19
slide-20
SLIDE 20

'

Alex Yakovlev Alex Yakovlev Hugo Simpson Ian Clark Eric Campbell Jordi Cortadella Kyller Gorgonio