Asynchronous Readers and Writers A Half-Synchronous Operator - - PowerPoint PPT Presentation

asynchronous readers and writers
SMART_READER_LITE
LIVE PREVIEW

Asynchronous Readers and Writers A Half-Synchronous Operator - - PowerPoint PPT Presentation

Asynchronous Readers and Writers A Half-Synchronous Operator Overview Introduction of the together with the and ! and ? versus and and using Design Level Semantics of , and Example Application The Future


slide-1
SLIDE 1

Asynchronous Readers and Writers

A Half-Synchronous Operator

slide-2
SLIDE 2

Overview

Introduction of the ó together with the ¡ and ¿ ! and ? versus ¡ and ¿ ¡ and ¿ using

♥ Design Level Semantics of ó, ¡ and ¿ Example Application The Future

AsynchronousReaders and Writers August 23, 2016 2 / 22

slide-3
SLIDE 3

Introduction, system overview

AsynchronousReaders and Writers August 23, 2016 3 / 22

slide-4
SLIDE 4

Introduction

➓ Purpose: Asynchronous Writing and Reading. ➓ ➓ ➓ ➓

AsynchronousReaders and Writers August 23, 2016 4 / 22

slide-5
SLIDE 5

Introduction

➓ Purpose: Asynchronous Writing and Reading. ➓ In CSP writing over a channel is restricted to two

processes interacting synchronously via an action containing the ! and the ?.

➓ ➓ ➓

AsynchronousReaders and Writers August 23, 2016 4 / 22

slide-6
SLIDE 6

Introduction

➓ Purpose: Asynchronous Writing and Reading. ➓ In CSP writing over a channel is restricted to two

processes interacting synchronously via an action containing the ! and the ?.

➓ Proposal: a half-synchronous action which allows a

process to write a value x over a channel c,

➓ ➓

AsynchronousReaders and Writers August 23, 2016 4 / 22

slide-7
SLIDE 7

Introduction

➓ Purpose: Asynchronous Writing and Reading. ➓ In CSP writing over a channel is restricted to two

processes interacting synchronously via an action containing the ! and the ?.

➓ Proposal: a half-synchronous action which allows a

process to write a value x over a channel c,

➓ without the requirement that the reading processes must

be in a state where they can read the value x over a channel c.

AsynchronousReaders and Writers August 23, 2016 4 / 22

slide-8
SLIDE 8

Introduction

➓ Purpose: Asynchronous Writing and Reading. ➓ In CSP writing over a channel is restricted to two

processes interacting synchronously via an action containing the ! and the ?.

➓ Proposal: a half-synchronous action which allows a

process to write a value x over a channel c,

➓ without the requirement that the reading processes must

be in a state where they can read the value x over a channel c.

➓ Together with a half-synchronous parallel alphabetised

  • perator.

AsynchronousReaders and Writers August 23, 2016 4 / 22

slide-9
SLIDE 9

Introduction

Advantages of the half-synchronous operator ó with half- synchronous actions containing ¡ or ¿:

➓ ➓ ➓

AsynchronousReaders and Writers August 23, 2016 5 / 22

slide-10
SLIDE 10

Introduction

Advantages of the half-synchronous operator ó with half- synchronous actions containing ¡ or ¿:

➓ it eases the complexity of the design eliminating arguably

complex process specifications:

➓ ➓

AsynchronousReaders and Writers August 23, 2016 5 / 22

slide-11
SLIDE 11

Introduction

Advantages of the half-synchronous operator ó with half- synchronous actions containing ¡ or ¿:

➓ it eases the complexity of the design eliminating arguably

complex process specifications:

  • it is not necessary to use a buffer process in the model to

achieve asynchronous writing and reading,

➓ ➓

AsynchronousReaders and Writers August 23, 2016 5 / 22

slide-12
SLIDE 12

Introduction

Advantages of the half-synchronous operator ó with half- synchronous actions containing ¡ or ¿:

➓ it eases the complexity of the design eliminating arguably

complex process specifications:

  • it is not necessary to use a buffer process in the model to

achieve asynchronous writing and reading,

  • the writes (¡) and reads (¿) are asynchronous, which

makes it possible to have an order of writes and reads that, if synchronous (!, ?), would lead to a deadlock,

➓ ➓

AsynchronousReaders and Writers August 23, 2016 5 / 22

slide-13
SLIDE 13

Introduction

Advantages of the half-synchronous operator ó with half- synchronous actions containing ¡ or ¿:

➓ it eases the complexity of the design eliminating arguably

complex process specifications:

  • it is not necessary to use a buffer process in the model to

achieve asynchronous writing and reading,

  • the writes (¡) and reads (¿) are asynchronous, which

makes it possible to have an order of writes and reads that, if synchronous (!, ?), would lead to a deadlock,

➓ by reducing the number of actions involved in this

asynchronous writing and reading of the processes, improves the performance of the periodic hard real-time application,

AsynchronousReaders and Writers August 23, 2016 5 / 22

slide-14
SLIDE 14

Introduction

Advantages of the half-synchronous operator ó with half- synchronous actions containing ¡ or ¿:

➓ it eases the complexity of the design eliminating arguably

complex process specifications:

  • it is not necessary to use a buffer process in the model to

achieve asynchronous writing and reading,

  • the writes (¡) and reads (¿) are asynchronous, which

makes it possible to have an order of writes and reads that, if synchronous (!, ?), would lead to a deadlock,

➓ by reducing the number of actions involved in this

asynchronous writing and reading of the processes, improves the performance of the periodic hard real-time application,

➓ in a distributed computing system, for example a

processor-coprocessor combination, the waiting time of the processor-coprocessor can be reduced.

AsynchronousReaders and Writers August 23, 2016 5 / 22

slide-15
SLIDE 15

Overview

Introduction of the ó together with the ¡ and ¿ ! and ? versus ¡ and ¿ ¡ and ¿ using

♥ Design Level Semantics of ó, ¡ and ¿ Example Application The Future

AsynchronousReaders and Writers August 23, 2016 6 / 22

slide-16
SLIDE 16

! and ? versus ¡ and ¿

Listing 1: Deadlock due to synchronous writing and reading A ✏ c!x1 Ñ c!y1 Ñ d?x2 Ñ d?y2 Ñ SKIP B ✏ c?x1 Ñ d!x2 Ñ c?y1 Ñ d!y2 Ñ SKIP AB ✏ A⑤⑤B ✏ Ñ Ñ Ñ Ñ ✏ Ñ Ñ Ñ Ñ ✏ ó Ñ Ñ Ñ Ñ Ñ Ñ Ñ Ñ

AsynchronousReaders and Writers August 23, 2016 7 / 22

slide-17
SLIDE 17

! and ? versus ¡ and ¿

Listing 1: Deadlock due to synchronous writing and reading A ✏ c!x1 Ñ c!y1 Ñ d?x2 Ñ d?y2 Ñ SKIP B ✏ c?x1 Ñ d!x2 Ñ c?y1 Ñ d!y2 Ñ SKIP AB ✏ A⑤⑤B trace: c.x1 ✏ Ñ Ñ Ñ Ñ ✏ Ñ Ñ Ñ Ñ ✏ ó Ñ Ñ Ñ Ñ Ñ Ñ Ñ Ñ

AsynchronousReaders and Writers August 23, 2016 7 / 22

slide-18
SLIDE 18

! and ? versus ¡ and ¿

Listing 1: Deadlock due to synchronous writing and reading A ✏ c!x1 Ñ c!y1 Ñ d?x2 Ñ d?y2 Ñ SKIP B ✏ c?x1 Ñ d!x2 Ñ c?y1 Ñ d!y2 Ñ SKIP AB ✏ A⑤⑤B trace: c.x1 Listing 2: No deadlock due to asynchronous writing and reading A ✏ c¡x1 Ñ c¡y1 Ñ d¿x2 Ñ d¿y2 Ñ SKIP B ✏ c¿x1 Ñ d¡x2 Ñ c¿y1 Ñ d¡y2 Ñ SKIP AB ✏ A ó B Ñ Ñ Ñ Ñ Ñ Ñ Ñ Ñ

AsynchronousReaders and Writers August 23, 2016 7 / 22

slide-19
SLIDE 19

! and ? versus ¡ and ¿

Listing 1: Deadlock due to synchronous writing and reading A ✏ c!x1 Ñ c!y1 Ñ d?x2 Ñ d?y2 Ñ SKIP B ✏ c?x1 Ñ d!x2 Ñ c?y1 Ñ d!y2 Ñ SKIP AB ✏ A⑤⑤B trace: c.x1 Listing 2: No deadlock due to asynchronous writing and reading A ✏ c¡x1 Ñ c¡y1 Ñ d¿x2 Ñ d¿y2 Ñ SKIP B ✏ c¿x1 Ñ d¡x2 Ñ c¿y1 Ñ d¡y2 Ñ SKIP AB ✏ A ó B many possible traces, for example: c¡x1 Ñ c¡y1 Ñ c¿x1 Ñ d¡x2 Ñ c¿y1 Ñ d¡y2 Ñ d¿x2 Ñ d¿y2 Ñ SKIP

AsynchronousReaders and Writers August 23, 2016 7 / 22

slide-20
SLIDE 20

Overview

Introduction of the ó together with the ¡ and ¿ ! and ? versus ¡ and ¿ ¡ and ¿ using

♥ Design Level Semantics of ó, ¡ and ¿ Example Application The Future

AsynchronousReaders and Writers August 23, 2016 8 / 22

slide-21
SLIDE 21

¡ and ¿ using

c¡x1 c¡y1 d¿x2 d¿y2 c¿x1 d¡x2 c¿y1 d¡y2 c¡x1 c¡y1 c¡y1 c¡y1 c¿x1 c¿x1 d¡x2 d¡x2 d¿x2 d¿x2 d¿x2 c¿y1 c¿y1 d¡y2 d¡y2 d¿y2 G1

♥G2 G2 G1

AsynchronousReaders and Writers August 23, 2016 9 / 22

slide-22
SLIDE 22

Overview

Introduction of the ó together with the ¡ and ¿ ! and ? versus ¡ and ¿ ¡ and ¿ using

♥ Design Level Semantics of ó, ¡ and ¿ Example Application The Future

AsynchronousReaders and Writers August 23, 2016 10 / 22

slide-23
SLIDE 23

Design Level

Separation of write/read actions in time Ñ Ñ Ñ Ñ ⑤⑤ ⑤⑤ Ñ Ñ ó

AsynchronousReaders and Writers August 23, 2016 11 / 22

slide-24
SLIDE 24

Design Level

Separation of write/read actions in time Needs a Buffer Ñ Ñ Ñ Ñ ⑤⑤ ⑤⑤ Ñ Ñ ó

AsynchronousReaders and Writers August 23, 2016 11 / 22

slide-25
SLIDE 25

Design Level

Separation of write/read actions in time Needs a Buffer A = write.x Ñ SKIP B = read.x Ñ SKIP Buffer = write.x Ñ read.x Ñ SKIP AB = A⑤⑤B⑤⑤Buffer Ñ Ñ ó

AsynchronousReaders and Writers August 23, 2016 11 / 22

slide-26
SLIDE 26

Design Level

Separation of write/read actions in time Needs a Buffer A = write.x Ñ SKIP B = read.x Ñ SKIP Buffer = write.x Ñ read.x Ñ SKIP AB = A⑤⑤B⑤⑤Buffer A = c¡x Ñ SKIP B = c¿x Ñ SKIP AB = A ó B

AsynchronousReaders and Writers August 23, 2016 11 / 22

slide-27
SLIDE 27

Overview

Introduction of the ó together with the ¡ and ¿ ! and ? versus ¡ and ¿ ¡ and ¿ using

♥ Design Level Semantics of ó, ¡ and ¿ Example Application The Future

AsynchronousReaders and Writers August 23, 2016 12 / 22

slide-28
SLIDE 28

Semantics of ó, ¡ and ¿

P

c ¡ x:T

ù P✶, Q1

c ¿ x:T

Ñ Q✶

1, ☎ ☎ ☎ , Qn c ¿ x:T

Ñ Q✶

n

P ó Q1ó☎ ☎ ☎ ó Qn

c ¡ x:T

ù P✶óQ1 ó ☎ ☎ ☎ó Qn

c ¿ x:T

Ñ P✶ó Q✶

1ó ☎ ☎ ☎ó Q✶ n

, c ¿ x : T ❘ ♣X, Zq Ñ

Ñ

ó Ñ ó

✘ P ♣ ☎ q ❘ ♣

✏ ☎☎☎ ✘

q ù

Ñ

ù

♣ ♣ùq ☎ ♣ ☎ ☎ ☎ qq ✏ ❍ Ñ

Ñ

AsynchronousReaders and Writers August 23, 2016 13 / 22

slide-29
SLIDE 29

Semantics of ó, ¡ and ¿

P

c ¡ x:T

ù P✶, Q1

c ¿ x:T

Ñ Q✶

1, ☎ ☎ ☎ , Qn c ¿ x:T

Ñ Q✶

n

P ó Q1ó☎ ☎ ☎ ó Qn

c ¡ x:T

ù P✶óQ1 ó ☎ ☎ ☎ó Qn

c ¿ x:T

Ñ P✶ó Q✶

1ó ☎ ☎ ☎ó Q✶ n

, c ¿ x : T ❘ ♣X, Zq Qi

c ¿ x:T

Ñ Q✶

i, Qj y

ÑQ✶

j

Qi óQj

y

ÑQi óQ✶

j

, y ✘ c ¿ x : T, c ¿ x : T P ♣Yi ☎ Yjq, y ❘ ♣X, Yk✏1,☎☎☎n,j✘k, Zq ù

Ñ

ù

♣ ♣ùq ☎ ♣ ☎ ☎ ☎ qq ✏ ❍ Ñ

Ñ

AsynchronousReaders and Writers August 23, 2016 13 / 22

slide-30
SLIDE 30

Semantics of ó, ¡ and ¿

P

c ¡ x:T

ù P✶, Q1

c ¿ x:T

Ñ Q✶

1, ☎ ☎ ☎ , Qn c ¿ x:T

Ñ Q✶

n

P ó Q1ó☎ ☎ ☎ ó Qn

c ¡ x:T

ù P✶óQ1 ó ☎ ☎ ☎ó Qn

c ¿ x:T

Ñ P✶ó Q✶

1ó ☎ ☎ ☎ó Q✶ n

, c ¿ x : T ❘ ♣X, Zq Qi

c ¿ x:T

Ñ Q✶

i, Qj y

ÑQ✶

j

Qi óQj

y

ÑQi óQ✶

j

, y ✘ c ¿ x : T, c ¿ x : T P ♣Yi ☎ Yjq, y ❘ ♣X, Yk✏1,☎☎☎n,j✘k, Zq P ù P✶, Qi

c ¿ x:T

Ñ Q✶

i

P ù P✶ , ♣α♣ùq ☎ ♣Y1, ☎ ☎ ☎ , Yn, Zqq ✏ ❍ Ñ

Ñ

AsynchronousReaders and Writers August 23, 2016 13 / 22

slide-31
SLIDE 31

Semantics of ó, ¡ and ¿

P

c ¡ x:T

ù P✶, Q1

c ¿ x:T

Ñ Q✶

1, ☎ ☎ ☎ , Qn c ¿ x:T

Ñ Q✶

n

P ó Q1ó☎ ☎ ☎ ó Qn

c ¡ x:T

ù P✶óQ1 ó ☎ ☎ ☎ó Qn

c ¿ x:T

Ñ P✶ó Q✶

1ó ☎ ☎ ☎ó Q✶ n

, c ¿ x : T ❘ ♣X, Zq Qi

c ¿ x:T

Ñ Q✶

i, Qj y

ÑQ✶

j

Qi óQj

y

ÑQi óQ✶

j

, y ✘ c ¿ x : T, c ¿ x : T P ♣Yi ☎ Yjq, y ❘ ♣X, Yk✏1,☎☎☎n,j✘k, Zq P ù P✶, Qi

c ¿ x:T

Ñ Q✶

i

P ù P✶ , ♣α♣ùq ☎ ♣Y1, ☎ ☎ ☎ , Yn, Zqq ✏ ❍ Qi

c ¡ x:T

Ñ Q✶

i, Qj c ¡ x:T

Ñ Q✶

j

SKIP , i ✘ j

AsynchronousReaders and Writers August 23, 2016 13 / 22

slide-32
SLIDE 32

Example

c¡x1 : T c¡xn : T waitForNextPeriod c¡x1 : T c¡xn : T waitForNextPeriod w a i t F

  • r

N e x t P e r i

  • d

w a i t F

  • r

N e x t P e r i

  • d

w a i t F

  • r

N e x t P e r i

  • d

w a i t F

  • r

N e x t P e r i

  • d

waitForNextPeriod c¿x1 : T c¿x1 : T c¿x1 : T c¿x1 : T c¡xn : T c¡xn : T c¿xn : T c¿xn : T

. . . . . . . . . ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎

AsynchronousReaders and Writers August 23, 2016 14 / 22

slide-33
SLIDE 33

Overview

Introduction of the ó together with the ¡ and ¿ ! and ? versus ¡ and ¿ ¡ and ¿ using

♥ Design Level Semantics of ó, ¡ and ¿ Example Application The Future

AsynchronousReaders and Writers August 23, 2016 15 / 22

slide-34
SLIDE 34

Case study

Application = c1 ! x1 : T Ñ c2 ? y1 : T Ñ ☎ ☎ ☎ c1 ! x8 : T Ñ c2 ? y8 : T Ñ display f♣y1, ☎ ☎ ☎ , y8q ÑSKIP Ñ Ñ Ñ Ñ ☎ ☎ ☎ Ñ Ñ Ñ Ñ ⑤⑤

AsynchronousReaders and Writers August 23, 2016 16 / 22

slide-35
SLIDE 35

Case study

Application = c1 ! x1 : T Ñ c2 ? y1 : T Ñ ☎ ☎ ☎ c1 ! x8 : T Ñ c2 ? y8 : T Ñ display f♣y1, ☎ ☎ ☎ , y8q ÑSKIP Controller = c1 ? x1 : T Ñ writeCoProc.x1 Ñ readCoProc.y1 Ñ c2 ! y1 : T Ñ ☎ ☎ ☎ c1 ? x8 : T Ñ writeCoProc.x8 Ñ readCoProc.y8 Ñ c2 ! y8 : T Ñ SKIP ⑤⑤

AsynchronousReaders and Writers August 23, 2016 16 / 22

slide-36
SLIDE 36

Case study

Application = c1 ! x1 : T Ñ c2 ? y1 : T Ñ ☎ ☎ ☎ c1 ! x8 : T Ñ c2 ? y8 : T Ñ display f♣y1, ☎ ☎ ☎ , y8q ÑSKIP Controller = c1 ? x1 : T Ñ writeCoProc.x1 Ñ readCoProc.y1 Ñ c2 ! y1 : T Ñ ☎ ☎ ☎ c1 ? x8 : T Ñ writeCoProc.x8 Ñ readCoProc.y8 Ñ c2 ! y8 : T Ñ SKIP System1 = ApplicationA⑤⑤CController

AsynchronousReaders and Writers August 23, 2016 16 / 22

slide-37
SLIDE 37

Example application

AP CP CoP 100 200 300 400 500 600 700 800 900 1000 1100

AsynchronousReaders and Writers August 23, 2016 17 / 22

slide-38
SLIDE 38

Example application

Application = c1 ¡ x1 : T Ñ ☎ ☎ ☎ Ñ c1 ¡ x8 : T Ñ c2 ¿ y1 : T Ñ ☎ ☎ ☎ Ñ c2 ¿ y8 : T Ñ display f♣y1, ☎ ☎ ☎ , y8q ÑSKIP Ñ Ñ Ñ Ñ ☎ ☎ ☎ Ñ Ñ Ñ Ñ ó

AsynchronousReaders and Writers August 23, 2016 18 / 22

slide-39
SLIDE 39

Example application

Application = c1 ¡ x1 : T Ñ ☎ ☎ ☎ Ñ c1 ¡ x8 : T Ñ c2 ¿ y1 : T Ñ ☎ ☎ ☎ Ñ c2 ¿ y8 : T Ñ display f♣y1, ☎ ☎ ☎ , y8q ÑSKIP Controller = c1 ¿ x1 : T Ñ writeCoProc.x1 Ñ readCoProc.y1 Ñ c2 ¡ y1 : T Ñ ☎ ☎ ☎ c1 ¿ x8 : T Ñ writeCoProc.x8 Ñ readCoProc.y8 Ñ c2 ¡ y8 : T Ñ SKIP ó

AsynchronousReaders and Writers August 23, 2016 18 / 22

slide-40
SLIDE 40

Example application

Application = c1 ¡ x1 : T Ñ ☎ ☎ ☎ Ñ c1 ¡ x8 : T Ñ c2 ¿ y1 : T Ñ ☎ ☎ ☎ Ñ c2 ¿ y8 : T Ñ display f♣y1, ☎ ☎ ☎ , y8q ÑSKIP Controller = c1 ¿ x1 : T Ñ writeCoProc.x1 Ñ readCoProc.y1 Ñ c2 ¡ y1 : T Ñ ☎ ☎ ☎ c1 ¿ x8 : T Ñ writeCoProc.x8 Ñ readCoProc.y8 Ñ c2 ¡ y8 : T Ñ SKIP System2 = ApplicationAóC Controller

AsynchronousReaders and Writers August 23, 2016 18 / 22

slide-41
SLIDE 41

Example application

AP CP CoP 100 200 300 400 500 600 700 800 900 1000

AsynchronousReaders and Writers August 23, 2016 19 / 22

slide-42
SLIDE 42

Overview

Introduction of the ó together with the ¡ and ¿ ! and ? versus ¡ and ¿ ¡ and ¿ using

♥ Design Level Semantics of ó, ¡ and ¿ Example Application The Future

AsynchronousReaders and Writers August 23, 2016 20 / 22

slide-43
SLIDE 43

The Future

Future work:

➓ ➓ ✌

➓ ➓

AsynchronousReaders and Writers August 23, 2016 21 / 22

slide-44
SLIDE 44

The Future

Future work:

➓ Index the half-synchronous action such that it is set-wise

asynchronous and intra-set-wise synchronous,

➓ ✌

➓ ➓

AsynchronousReaders and Writers August 23, 2016 21 / 22

slide-45
SLIDE 45

The Future

Future work:

➓ Index the half-synchronous action such that it is set-wise

asynchronous and intra-set-wise synchronous,

➓ elaborate the graph-theoretical characteristics of ✌

♥ (VRSP together with the half-synchronous operator),

➓ ➓

AsynchronousReaders and Writers August 23, 2016 21 / 22

slide-46
SLIDE 46

The Future

Future work:

➓ Index the half-synchronous action such that it is set-wise

asynchronous and intra-set-wise synchronous,

➓ elaborate the graph-theoretical characteristics of ✌

♥ (VRSP together with the half-synchronous operator), i.e. it is a commutative monoid of consistent graphs,

➓ ➓

AsynchronousReaders and Writers August 23, 2016 21 / 22

slide-47
SLIDE 47

The Future

Future work:

➓ Index the half-synchronous action such that it is set-wise

asynchronous and intra-set-wise synchronous,

➓ elaborate the graph-theoretical characteristics of ✌

♥ (VRSP together with the half-synchronous operator), i.e. it is a commutative monoid of consistent graphs,

➓ implementation in a tool-chain ➓

AsynchronousReaders and Writers August 23, 2016 21 / 22

slide-48
SLIDE 48

The Future

Future work:

➓ Index the half-synchronous action such that it is set-wise

asynchronous and intra-set-wise synchronous,

➓ elaborate the graph-theoretical characteristics of ✌

♥ (VRSP together with the half-synchronous operator), i.e. it is a commutative monoid of consistent graphs,

➓ implementation in a tool-chain and ➓ perform a case-study on a periodic hard real-time system.

AsynchronousReaders and Writers August 23, 2016 21 / 22

slide-49
SLIDE 49

Thanks!

AsynchronousReaders and Writers August 23, 2016 22 / 22