Asynchronous Readers and Writers A Half-Synchronous Operator - - PowerPoint PPT Presentation
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
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
Introduction, system overview
AsynchronousReaders and Writers August 23, 2016 3 / 22
Introduction
➓ Purpose: Asynchronous Writing and Reading. ➓ ➓ ➓ ➓
AsynchronousReaders and Writers August 23, 2016 4 / 22
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
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
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
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
Introduction
Advantages of the half-synchronous operator ó with half- synchronous actions containing ¡ or ¿:
➓ ➓ ➓
AsynchronousReaders and Writers August 23, 2016 5 / 22
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
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
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
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
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
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
! 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
! 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
! 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
! 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
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
¡ 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
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
Design Level
Separation of write/read actions in time Ñ Ñ Ñ Ñ ⑤⑤ ⑤⑤ Ñ Ñ ó
AsynchronousReaders and Writers August 23, 2016 11 / 22
Design Level
Separation of write/read actions in time Needs a Buffer Ñ Ñ Ñ Ñ ⑤⑤ ⑤⑤ Ñ Ñ ó
AsynchronousReaders and Writers August 23, 2016 11 / 22
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
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
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
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
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
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
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
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
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
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
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
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
Example application
AP CP CoP 100 200 300 400 500 600 700 800 900 1000 1100
AsynchronousReaders and Writers August 23, 2016 17 / 22
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
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
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
Example application
AP CP CoP 100 200 300 400 500 600 700 800 900 1000
AsynchronousReaders and Writers August 23, 2016 19 / 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 20 / 22
The Future
Future work:
➓ ➓ ✌
♥
➓ ➓
AsynchronousReaders and Writers August 23, 2016 21 / 22
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
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
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
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
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
Thanks!
AsynchronousReaders and Writers August 23, 2016 22 / 22