and efficient implementations of synchronous models on asynchronous execution platforms Stavros Tripakis UC Berkeley and Verimag EC2 Workshop Grenoble June 2009 Some observations ID: 216578
Download Presentation The PPT/PDF document "1 Correct" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
1
Correct and efficient implementations of synchronous models on asynchronous execution platforms
Stavros TripakisUC Berkeley and Verimag
EC^2 Workshop, Grenoble, June 2009Slide2
Some observations
Concurrency => interleavingC.f., synchronous systems (e.g., circuits)Concurrency => non-determinismsynchronous circuits are deterministicConcurrency => shared memoryC.f., data flow modelsAsynchronous concurrency (interleaving) => non-determinism C.f., Kahn Process Networks
2
Threads have conquered the world, but …Slide3
What are the problems we (as a community) are trying to solve?
Cope with concurrency… but what does it mean?What are the right execution platforms?Which multicore architecture, memory model, …What are the right programming models?For which types of applications?How to map the latter to the former?Correctly and efficiently!
How to verify stuff?
± given,
synchronous
given,
asynchronous
focus
3Slide4
Synchronous vs. asynchronous concurrency
Synchronous concurrencyExecution platforms: synchronous hardwareProgramming models: Simulink, SCADE, synchronous languages (Esterel, Lustre, …), …Asynchronous concurrency
Execution platforms: many, including distributed platformsProgramming models: thread-based (often communicating by shared-memory)4Slide5
Concurrency => non-determinism
Most synchronous models are deterministic: synchronous hardware, Simulink, SCADE, most synchronous languages, …
5
Copyright The Mathworks
Engine control model in
SimulinkSlide6
Concurrency => non-determinism
Some asynchronous models are also deterministic, e.g.:Kahn Process Networks: the sequence of values (stream) produced at each FIFO is the same independent of process interleaving
6Slide7
Our choice of programming model: synchronous
Set of parallel processes, notion of global synchronous cycleSimulink, SCADE, VHDL, Verilog, Lustre, Esterel, …Main advantages:Determinism, no process interleaving:
Easier to understand, easier to verify (less state explosion)Main objections:“Synchrony is impossible/hard/too expensive to implement”“This is especially true for distributed systems”“You need clock synchronization”Practice seems to agree with this…Most available implementations of synchronous systems are either synchronous hardware, or centralized “read; compute; write;” control loops.
…but it is
not
quite true.
7Slide8
8Semantics-preserving implementation of synchronous models
Simulinksingle-processor
single-task
single-processor
multi-task
distributed,
synchronous
(TTA)
…
…
distributed,
asynchronous
(KPN,
LTTA, ...)
application
execution
platform
design
implementationSlide9
9
From synchronous models to asynchronous distributed implementationsJoint work with Claudio Pinello, CadenceAlberto Sangiovanni-Vincentelli, UC Berkeley
Albert Benveniste, IRISA (France)Paul Caspi, VERIMAG (France)Marco di Natale, SSSA (Italy)[IEEE Trans. Computers, Oct’08]Slide10
Implementation on asynchronous distributed platforms
Asynchronous distributed platforms:
Many computers, each with a local clock
No clock synchronization
Computers communicate using some network/protocol
Don’t care which network, as long as finite FIFO queues (TCP) can be implemented on top
synchronous model
asynchronous platform
with some communication network
10Slide11
Implementation on asynchronous distributed platforms
synchronous model
asynchronous platform
with some communication network
Intermediate layer:
asynchronous processes
communicating
with finite FIFO queues
11Slide12
Implementation on asynchronous distributed platforms
synchronous model
Intermediate layer:
asynchronous processes
communicating
with finite FIFO queues
12
This is like
Kahn Process Networks
with blocking write()
when FIFO is full.
FIFOs must be large
enough to avoid
deadlocks.
=>
semantical
(stream) preservationSlide13
Semantical preservation: proof
Use old theories [1970s]:Marked graphsSubclass of Petri NetsUsed to show FFP liveness (no deadlock)
Kahn Process NetworksUsed Kahn’s fundamental result: determinismStreams do not depend on process interleaving13Slide14
Performance analysis: worst-case
logical-time throughput and latency14
P1
P2
P1
P2
WCLTT = 1/2
WCLTT = 1Slide15
15
From synchronous models toasynchronous multitask implementationsJoint work with Paul
Caspi, Norman Scaife, Christos Sofronis, VERIMAG
[ACM Trans. Embed. Comp. Sys., Feb’08]Slide16
Implementation on centralized, multitasking platforms
16
Sync Single-processorPriority scheduling(fixed priority or EDF)
scheduler
T
1
T
2
T
3
tasks
Why multitasking and not single “real-compute-write” loop?
For
multi-rate
models:
Multitask implementation schedulable, but single-task not schedulableSlide17
Implementation on centralized, multitasking platforms
17
Sync Single-processorPriority scheduling(fixed priority or EDF)
scheduler
T
1
T
2
T
3
tasks
Goal:
semantical
preservationSlide18
Implementation on centralized, multitasking platforms
18
Sync Single-processorPriority scheduling(fixed priority or EDF)
scheduler
T
1
T
2
T
3
tasks
non-blocking (wait-free)
memory-optimal
semantics-preservingSlide19
Conclusions
Concurrency => non-determinismSynchronous models are deterministiceasier to understand and verifySynchronous models can be implemented on a variety of asynchronous execution platforms, using non-trivial techniques:Implementations are correct-by-constructionThey are memory-optimalPerformance (throughput, latency, …) can be analyzed and optimized
19Slide20
Open questions
For which applications is the synchronous programming model suitable?Traditionally for control: avionics, automotive, …Some recent works trying to apply it to multimedia/signal processingTo what extent these methods apply to multicores?Are dataflow computers going to come back?
20