SlideShare uma empresa Scribd logo
1 de 18
Baixar para ler offline
Towards an Integration of the Actor
Model in an FRP Language for
Small-Scale Embedded Systems
Takuo Watanabe & Kensuke Sawada
Department of Computer Science, Tokyo Institute of Technology
Oct. 30, 2016
AGERE!@SPLASH 2016
1
About This Work
• An actor-based execution model of a pure FRP
languages for small-scale embedded systems
• Objective
- flexible execution models
- open/customizable interface with higher-level abstraction
• Talk Outline
- EmFRP
- Runtime System
- Actor-Based Runtime Implementation
- Future Work
2
"Small-Scale" Embedded Systems
• Resource-Constrained Systems
- Processor: 8–32bit
- Clock: ≤ 100MHz
- Program Storage: ≤ 1M words
- RAM: ≤ 1M bytes
- No MMU
• w/o full-fledged OS (e.g., Linux)
- embedded in special purpose devices
• ex) Microcontrollers
- PIC, AVR, H8, ARM Cortex-M, etc.
3
Emfrp [Sawada & Watanabe, CROW2016]
• An FRP language for small-scale embedded systems
- Strongly-typed, Purely functional
• parametric polymorphism & type inference
• algebraic data types & pattern matching
- Simple abstraction for time-varying values (aka signals)
• node: named, non-first-class representation
• lifting-free
- Bounded & predictable amount of runtime memory
• syntactic restrictions & type system
• github.com/sawaken/emfrp
- Compiler & Interpreter (written in Ruby)
• The compiler generates platform-independent ANSI-C code
runnable several microcontrollers (AVR, ARM Cortex-M)
4
Ex1: Air-Conditioner Controller in Emfrp
5
01: module ACController # module name
02: in tmp : Float, # temperature sensor
03: hmd : Float # humidity sensor
04: out ac : Bool # air-conditioner
05: use Std # standard library
06:
07: # discomfort (temperature-humidity) index
08: node di = 0.81 * tmp + 0.01 * hmd
09: * (0.99 * tmp - 14.3) + 46.3
10:
11: # air-conditioner status
12: node init[False] ac = di >= 75.0 + ho
13:
14: # hysteresis offset
15: node ho = if ac@last then -0.5 else 0.5
History-Sensitive Behavior with @last
6
# air-conditioner status
node ac = di >= 75.0
# air-conditioner status
node init[False] ac =
di >= 75.0 + ho
# hysteresis offset
node ho = if ac@last
then -0.5 else 0.5
75.0
di
ac
75.0
di
ac
Emfrp syntax for referring to the previous value of an
arbitrary node (cf. foldp in Elm)
Case Study: Digital Clock [CROW2016]
• Target: mbed LPC1768
- ARM Cortex M3, 96MHz
- RAM 32K, Flash 512K
- LCD, 3 Buttons
• Code
- Emfrp: 80 loc
- Glue code in C++: 45 loc
- External Libraries
• Compiled Code
- Generated C code: 592 loc
- Binary (ARM RVDS4.1)
• w/o library : 2.3 KB
• w/ library: 30.1 KB
7
Related Work
8
Yampa
(FRP)
Elm
(FRP)
Céu
(procedural)
Simulink
(dataflow)
CFRP*
(FRP)
Emfrp
(FRP)
Usable for Small-Scale
Embedded Systems ✕ ✕ ⃝ ⃝ ⃝ ⃝
Frist-Class Functions ⃝ ⃝ ⃝ ✕ ⃝ ✕
Algebraic Data Types
& Pattern Matching ⃝ ⃝ ✕ ✕ ✕ ⃝
Declarative Programming
& Referential Transparency ⃝ ⃝ ✕ △ ⃝ ⃝
Automated Unit Test ⃝ ⃝ ✕ ⃝ ✕ ⃝
Modularity & Abstractness ⃝ ⃝ △ ⃝ ⃝ ⃝
*Another FRP language developed by use in prior to Emfrp
DAG Representation of Ex1
9
tmp
(Float)
hmd
(Float)
di
(Float)
ac
(Bool)
ho
(Float)
temperature
sensor
humidity
sensor
discomfort index
air-
conditioner
air-conditioner
status
hysteresis offset
node dependency
past-value dependencynode
device connection
Push-Based Execution Model of Emfrp
10
tmp
(Float)
hmd
(Float)
di
(Float)
ac
(Bool)
ho
(Float)
tmp hmd di ho ac
iteration
The runtime system
updates the values of the
nodes by repeatedly
evaluating them in an order
compatible to the DAG.
module ACController # module name
in tmp : Float, # temperature sensor
hmd : Float # humidity sensor
pulse10ms : Bool # hardware interval timer (10ms)
out ac : Bool, # air-conditioner
led : Bool # LED
use Std # standard library
# discomfort (temperature-humidity) index
node di = 0.81 * tmp + 0.01 * hmd * (0.99 * tmp - 14.3) + 46.3
# timer counter (resets to 0 every 1 minute)
node init[0] timer =
if !pulse10ms@last && pulse10ms
then (timer@last + 1) % 6000 else timer@last
# air-conditioner switch
node ac = if timer@last != timer && timer == 0
then di >= 75.0 else ac@last
# LED blinks at 1Hz
node led = (timer % 100) < 50
Ex2: A Timer-Based Air-Conditioner Controller
11
Actor-Based Execution Model
• With the push-based execution model, tmp, hmd and di
are evaluated in every iteration. However, the value of
them required only once per minute.
• In this work, we adopt an actor representation of
nodes to provide flexible runtime strategies and good
abstractions runtime access
- one actor (implemented as a C++ object) per node
- message-based dependency propagation
• single dispatch queue model
• transmission order preservation (a la ABCL)
- customizable scheduling via reflection (GWR)
• GWR = Reflection on Actor-Groups [Watanabe, AGERE2013]
12
DAG Representation of Ex2
13
tmp
(Float)
hmd
(Float)
di
(Float)
ac
(Bool)
timer
(Int)
temperature
sensor
humidity
sensor
air-
conditioner
led
(Bool)
hardware
timer
pulse
10ms
(Bool)
LED
class TMPNode : public Actor {
public:
TMPNode(Actor2 *di, TMPSensor *tmp);
virtual ~TMPNode() {}
virtual void activate(Message *m);
private:
Actor2 *di;
TMPSensor *tmp;
}
void TMPNode::activate(Message *m) {
di->send1(Message::floatMessage(tmp->read(), m->cust));
}
class DINode : public Actor2 {
public:
DINode(Actor *ac) ac(ac) { ... }
virtual ~DINode() {}
virtual void activate(Message *m);
private:
Actor *ac;
}
void DINode::activate(Message *mt, Message *mh) {
assert(mt->cust == mh->cust);
float t = mt->getFloat(), h = mh->getFloat();
float di = 0.81 * t + 0.01 * h * (0.99 * t - 14.3) + 46.3;
ac->send(Message::floatMessage(di, mt->cust));
}
Actor-Based
Representation of
Nodes in Ex2
14
Ex: Delayed (Lazy/Pull) Blocks
• An expression suffixed with @delay indicates that the
expression is evaluated only when it is required.
• Nodes in a delayed block and their dependent nodes
are evaluated in a separate actor group that is
activated only when it is needed.
15
# air-conditioner switch
node ac = if timer@last != timer && timer == 0
then (di >= 75.0)@delay else ac@last
The Actor-Group for the Delayed Block
• Actors in the group
for the delayed block
is detached from the
main iteration path.
- They have separate
message queue.
• The detached actor
group is activated by
sending an activation
message from ac
when they are
needed.
16
tmp
(Float)
hmd
(Float)
di
(Float)
ac
(Bool)
timer
(Int)
led
(Bool)
pulse
10ms
(Bool)
class DINode : public Actor2 { ... }
void DINode::activate(Message *mt, Message *mh) {
float t = mt->getFloat(), h = mh->getFloat();
float di = 0.81 * t + 0.01 * h * (0.99 * t - 14.3) + 46.3;
mt->cust->send(mkFloatMessage(di, mt->cust));
}
class ACNode : public Actor { ... }
void ACNode::activate(Message *m) {
if (m->prevInt() != m->getInt() &&
m->getInt() == 0) {
acDelayedBlockGroup->send(Message::unitMessage(&acDelayedBlock));
}
}
class ACDelayedBlock : public Actor { ...}
void ACDelayedBlock::activate(Message *m) {
m->cust->send(
Message::booleanMessage(m->getFloat() > 75.0, m->cust));
}
17
Summary & Future Work
• Proposed an actor-based execution model of Emfrp.
- actor representation of nodes (time-varying values)
- GWR for flexible execution strategies
• Future Work
- Possible Applications
• Asynchronous (Future) Node
- heavy node / slow peripheral devices / inter-device communication
• Group-Wide Iteration Control
- periodical iteration / deep sleep mode / interrupts from devices
• Actors as signal values
- Relationship to other concurrent / event models
- Better (meta-level) interface
- Implementation
18

Mais conteúdo relacionado

Mais procurados

Semaphores and Monitors
 Semaphores and Monitors Semaphores and Monitors
Semaphores and Monitorssathish sak
 
Concurrent Programming OpenMP @ Distributed System Discussion
Concurrent Programming OpenMP @ Distributed System DiscussionConcurrent Programming OpenMP @ Distributed System Discussion
Concurrent Programming OpenMP @ Distributed System DiscussionCherryBerry2
 
Semophores and it's types
Semophores and it's typesSemophores and it's types
Semophores and it's typesNishant Joshi
 
Introduction to OpenMP (Performance)
Introduction to OpenMP (Performance)Introduction to OpenMP (Performance)
Introduction to OpenMP (Performance)Akhila Prabhakaran
 
Identifying Optimal Trade-Offs between CPU Time Usage and Temporal Constraints
Identifying Optimal Trade-Offs between CPU Time Usage and Temporal ConstraintsIdentifying Optimal Trade-Offs between CPU Time Usage and Temporal Constraints
Identifying Optimal Trade-Offs between CPU Time Usage and Temporal ConstraintsLionel Briand
 
Presentation on Shared Memory Parallel Programming
Presentation on Shared Memory Parallel ProgrammingPresentation on Shared Memory Parallel Programming
Presentation on Shared Memory Parallel ProgrammingVengada Karthik Rangaraju
 
Lab3 advanced port scanning 30 oct 21
Lab3 advanced port scanning 30 oct 21Lab3 advanced port scanning 30 oct 21
Lab3 advanced port scanning 30 oct 21Hussain111321
 
Jvm profiling under the hood
Jvm profiling under the hoodJvm profiling under the hood
Jvm profiling under the hoodRichardWarburton
 
Module-related pages
Module-related pagesModule-related pages
Module-related pagesbutest
 
Simple asynchronous remote invocations for distributed real-time Java
Simple asynchronous remote invocations for distributed real-time JavaSimple asynchronous remote invocations for distributed real-time Java
Simple asynchronous remote invocations for distributed real-time JavaUniversidad Carlos III de Madrid
 

Mais procurados (20)

MPI n OpenMP
MPI n OpenMPMPI n OpenMP
MPI n OpenMP
 
Semaphores and Monitors
 Semaphores and Monitors Semaphores and Monitors
Semaphores and Monitors
 
Introduction to OpenMP
Introduction to OpenMPIntroduction to OpenMP
Introduction to OpenMP
 
Enhancing the region model of RTSJ
Enhancing the region model of RTSJEnhancing the region model of RTSJ
Enhancing the region model of RTSJ
 
Concurrent Programming OpenMP @ Distributed System Discussion
Concurrent Programming OpenMP @ Distributed System DiscussionConcurrent Programming OpenMP @ Distributed System Discussion
Concurrent Programming OpenMP @ Distributed System Discussion
 
openmp
openmpopenmp
openmp
 
Semophores and it's types
Semophores and it's typesSemophores and it's types
Semophores and it's types
 
Semaphore
SemaphoreSemaphore
Semaphore
 
Open mp intro_01
Open mp intro_01Open mp intro_01
Open mp intro_01
 
OpenMP
OpenMPOpenMP
OpenMP
 
Introduction to OpenMP (Performance)
Introduction to OpenMP (Performance)Introduction to OpenMP (Performance)
Introduction to OpenMP (Performance)
 
No Heap Remote Objects for Distributed real-time Java
No Heap Remote Objects for Distributed real-time JavaNo Heap Remote Objects for Distributed real-time Java
No Heap Remote Objects for Distributed real-time Java
 
Identifying Optimal Trade-Offs between CPU Time Usage and Temporal Constraints
Identifying Optimal Trade-Offs between CPU Time Usage and Temporal ConstraintsIdentifying Optimal Trade-Offs between CPU Time Usage and Temporal Constraints
Identifying Optimal Trade-Offs between CPU Time Usage and Temporal Constraints
 
Presentation on Shared Memory Parallel Programming
Presentation on Shared Memory Parallel ProgrammingPresentation on Shared Memory Parallel Programming
Presentation on Shared Memory Parallel Programming
 
Lab3 advanced port scanning 30 oct 21
Lab3 advanced port scanning 30 oct 21Lab3 advanced port scanning 30 oct 21
Lab3 advanced port scanning 30 oct 21
 
Mutual exclusion and sync
Mutual exclusion and syncMutual exclusion and sync
Mutual exclusion and sync
 
Open mp directives
Open mp directivesOpen mp directives
Open mp directives
 
Jvm profiling under the hood
Jvm profiling under the hoodJvm profiling under the hood
Jvm profiling under the hood
 
Module-related pages
Module-related pagesModule-related pages
Module-related pages
 
Simple asynchronous remote invocations for distributed real-time Java
Simple asynchronous remote invocations for distributed real-time JavaSimple asynchronous remote invocations for distributed real-time Java
Simple asynchronous remote invocations for distributed real-time Java
 

Destaque

A Reflective Approach to Actor-Based Concurrent Context-Oriented Systems
A Reflective Approach to Actor-Based Concurrent Context-Oriented SystemsA Reflective Approach to Actor-Based Concurrent Context-Oriented Systems
A Reflective Approach to Actor-Based Concurrent Context-Oriented SystemsTakuo Watanabe
 
A Reflective Implementation of an Actor-based Concurrent Context-Oriented System
A Reflective Implementation of an Actor-based Concurrent Context-Oriented SystemA Reflective Implementation of an Actor-based Concurrent Context-Oriented System
A Reflective Implementation of an Actor-based Concurrent Context-Oriented SystemTakuo Watanabe
 
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...Shinpei Hayashi
 
Class Responsibility Assignment as Fuzzy Constraint Satisfaction
Class Responsibility Assignment as Fuzzy Constraint SatisfactionClass Responsibility Assignment as Fuzzy Constraint Satisfaction
Class Responsibility Assignment as Fuzzy Constraint SatisfactionShinpei Hayashi
 
Modeling and Utilizing Security Knowledge for Eliciting Security Requirements
Modeling and Utilizing Security Knowledge for Eliciting Security RequirementsModeling and Utilizing Security Knowledge for Eliciting Security Requirements
Modeling and Utilizing Security Knowledge for Eliciting Security RequirementsShinpei Hayashi
 
Incremental Feature Location and Identification in Source Code
Incremental Feature Location and Identification in Source CodeIncremental Feature Location and Identification in Source Code
Incremental Feature Location and Identification in Source CodeHiroshi Kazato
 
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...Shinpei Hayashi
 
Refactoring Edit History of Source Code
Refactoring Edit History of Source CodeRefactoring Edit History of Source Code
Refactoring Edit History of Source CodeShinpei Hayashi
 
Feature Location for Multi-Layer System Based on Formal Concept Analysis
Feature Location for Multi-Layer System Based on Formal Concept AnalysisFeature Location for Multi-Layer System Based on Formal Concept Analysis
Feature Location for Multi-Layer System Based on Formal Concept AnalysisHiroshi Kazato
 
Guiding Identification of Missing Scenarios for Dynamic Feature Location
Guiding Identification of Missing Scenarios for Dynamic Feature LocationGuiding Identification of Missing Scenarios for Dynamic Feature Location
Guiding Identification of Missing Scenarios for Dynamic Feature LocationShinpei Hayashi
 
Detecting Occurrences of Refactoring with Heuristic Search
Detecting Occurrences of Refactoring with Heuristic SearchDetecting Occurrences of Refactoring with Heuristic Search
Detecting Occurrences of Refactoring with Heuristic SearchShinpei Hayashi
 
Terminology Matching of Requirements Specification Documents and Regulations ...
Terminology Matching of Requirements Specification Documents and Regulations ...Terminology Matching of Requirements Specification Documents and Regulations ...
Terminology Matching of Requirements Specification Documents and Regulations ...Shinpei Hayashi
 
Toward Understanding How Developers Recognize Features in Source Code from De...
Toward Understanding How Developers Recognize Features in Source Code from De...Toward Understanding How Developers Recognize Features in Source Code from De...
Toward Understanding How Developers Recognize Features in Source Code from De...Shinpei Hayashi
 
Understanding Source Code Differences by Separating Refactoring Effects
Understanding Source Code Differences by Separating Refactoring EffectsUnderstanding Source Code Differences by Separating Refactoring Effects
Understanding Source Code Differences by Separating Refactoring EffectsShinpei Hayashi
 
iFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature ImplementationsiFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature ImplementationsShinpei Hayashi
 
Toward Structured Location of Features
Toward Structured Location of FeaturesToward Structured Location of Features
Toward Structured Location of FeaturesHiroshi Kazato
 
Supporting Design Model Refactoring for Improving Class Responsibility Assign...
Supporting Design Model Refactoring for Improving Class Responsibility Assign...Supporting Design Model Refactoring for Improving Class Responsibility Assign...
Supporting Design Model Refactoring for Improving Class Responsibility Assign...Shinpei Hayashi
 
Sentence-to-Code Traceability Recovery with Domain Ontologies
Sentence-to-Code Traceability Recovery with Domain OntologiesSentence-to-Code Traceability Recovery with Domain Ontologies
Sentence-to-Code Traceability Recovery with Domain OntologiesShinpei Hayashi
 
Visualizing Stakeholder Concerns with Anchored Map
Visualizing Stakeholder Concerns with Anchored MapVisualizing Stakeholder Concerns with Anchored Map
Visualizing Stakeholder Concerns with Anchored MapTakanori Ugai
 
FOSE2010 ミニチュートリアル 「データマイニング技術を応用したソフトウェア構築・保守支援」
FOSE2010 ミニチュートリアル 「データマイニング技術を応用したソフトウェア構築・保守支援」FOSE2010 ミニチュートリアル 「データマイニング技術を応用したソフトウェア構築・保守支援」
FOSE2010 ミニチュートリアル 「データマイニング技術を応用したソフトウェア構築・保守支援」Takashi Kobayashi
 

Destaque (20)

A Reflective Approach to Actor-Based Concurrent Context-Oriented Systems
A Reflective Approach to Actor-Based Concurrent Context-Oriented SystemsA Reflective Approach to Actor-Based Concurrent Context-Oriented Systems
A Reflective Approach to Actor-Based Concurrent Context-Oriented Systems
 
A Reflective Implementation of an Actor-based Concurrent Context-Oriented System
A Reflective Implementation of an Actor-based Concurrent Context-Oriented SystemA Reflective Implementation of an Actor-based Concurrent Context-Oriented System
A Reflective Implementation of an Actor-based Concurrent Context-Oriented System
 
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
 
Class Responsibility Assignment as Fuzzy Constraint Satisfaction
Class Responsibility Assignment as Fuzzy Constraint SatisfactionClass Responsibility Assignment as Fuzzy Constraint Satisfaction
Class Responsibility Assignment as Fuzzy Constraint Satisfaction
 
Modeling and Utilizing Security Knowledge for Eliciting Security Requirements
Modeling and Utilizing Security Knowledge for Eliciting Security RequirementsModeling and Utilizing Security Knowledge for Eliciting Security Requirements
Modeling and Utilizing Security Knowledge for Eliciting Security Requirements
 
Incremental Feature Location and Identification in Source Code
Incremental Feature Location and Identification in Source CodeIncremental Feature Location and Identification in Source Code
Incremental Feature Location and Identification in Source Code
 
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...
 
Refactoring Edit History of Source Code
Refactoring Edit History of Source CodeRefactoring Edit History of Source Code
Refactoring Edit History of Source Code
 
Feature Location for Multi-Layer System Based on Formal Concept Analysis
Feature Location for Multi-Layer System Based on Formal Concept AnalysisFeature Location for Multi-Layer System Based on Formal Concept Analysis
Feature Location for Multi-Layer System Based on Formal Concept Analysis
 
Guiding Identification of Missing Scenarios for Dynamic Feature Location
Guiding Identification of Missing Scenarios for Dynamic Feature LocationGuiding Identification of Missing Scenarios for Dynamic Feature Location
Guiding Identification of Missing Scenarios for Dynamic Feature Location
 
Detecting Occurrences of Refactoring with Heuristic Search
Detecting Occurrences of Refactoring with Heuristic SearchDetecting Occurrences of Refactoring with Heuristic Search
Detecting Occurrences of Refactoring with Heuristic Search
 
Terminology Matching of Requirements Specification Documents and Regulations ...
Terminology Matching of Requirements Specification Documents and Regulations ...Terminology Matching of Requirements Specification Documents and Regulations ...
Terminology Matching of Requirements Specification Documents and Regulations ...
 
Toward Understanding How Developers Recognize Features in Source Code from De...
Toward Understanding How Developers Recognize Features in Source Code from De...Toward Understanding How Developers Recognize Features in Source Code from De...
Toward Understanding How Developers Recognize Features in Source Code from De...
 
Understanding Source Code Differences by Separating Refactoring Effects
Understanding Source Code Differences by Separating Refactoring EffectsUnderstanding Source Code Differences by Separating Refactoring Effects
Understanding Source Code Differences by Separating Refactoring Effects
 
iFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature ImplementationsiFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature Implementations
 
Toward Structured Location of Features
Toward Structured Location of FeaturesToward Structured Location of Features
Toward Structured Location of Features
 
Supporting Design Model Refactoring for Improving Class Responsibility Assign...
Supporting Design Model Refactoring for Improving Class Responsibility Assign...Supporting Design Model Refactoring for Improving Class Responsibility Assign...
Supporting Design Model Refactoring for Improving Class Responsibility Assign...
 
Sentence-to-Code Traceability Recovery with Domain Ontologies
Sentence-to-Code Traceability Recovery with Domain OntologiesSentence-to-Code Traceability Recovery with Domain Ontologies
Sentence-to-Code Traceability Recovery with Domain Ontologies
 
Visualizing Stakeholder Concerns with Anchored Map
Visualizing Stakeholder Concerns with Anchored MapVisualizing Stakeholder Concerns with Anchored Map
Visualizing Stakeholder Concerns with Anchored Map
 
FOSE2010 ミニチュートリアル 「データマイニング技術を応用したソフトウェア構築・保守支援」
FOSE2010 ミニチュートリアル 「データマイニング技術を応用したソフトウェア構築・保守支援」FOSE2010 ミニチュートリアル 「データマイニング技術を応用したソフトウェア構築・保守支援」
FOSE2010 ミニチュートリアル 「データマイニング技術を応用したソフトウェア構築・保守支援」
 

Semelhante a Towards an Integration of the Actor Model in an FRP Language for Small-Scale Embedded Systems

Threads and multi threading
Threads and multi threadingThreads and multi threading
Threads and multi threadingAntonio Cesarano
 
Hs java open_party
Hs java open_partyHs java open_party
Hs java open_partyOpen Party
 
Design & Analysis of Algorithm course .pptx
Design & Analysis of Algorithm course .pptxDesign & Analysis of Algorithm course .pptx
Design & Analysis of Algorithm course .pptxJeevaMCSEKIOT
 
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...DataWorks Summit/Hadoop Summit
 
Week1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC BeginWeek1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC Begin敬倫 林
 
Pretzel: optimized Machine Learning framework for low-latency and high throug...
Pretzel: optimized Machine Learning framework for low-latency and high throug...Pretzel: optimized Machine Learning framework for low-latency and high throug...
Pretzel: optimized Machine Learning framework for low-latency and high throug...NECST Lab @ Politecnico di Milano
 
CIS3110 Winter 2016CIS3110 (Operating Systems) Assig.docx
CIS3110 Winter 2016CIS3110 (Operating Systems) Assig.docxCIS3110 Winter 2016CIS3110 (Operating Systems) Assig.docx
CIS3110 Winter 2016CIS3110 (Operating Systems) Assig.docxclarebernice
 
Simple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorialSimple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorialJin-Hwa Kim
 
Parallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMPParallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMPAnil Bohare
 
Strata Singapore: Gearpump Real time DAG-Processing with Akka at Scale
Strata Singapore: GearpumpReal time DAG-Processing with Akka at ScaleStrata Singapore: GearpumpReal time DAG-Processing with Akka at Scale
Strata Singapore: Gearpump Real time DAG-Processing with Akka at ScaleSean Zhong
 
JVM Memory Model - Yoav Abrahami, Wix
JVM Memory Model - Yoav Abrahami, WixJVM Memory Model - Yoav Abrahami, Wix
JVM Memory Model - Yoav Abrahami, WixCodemotion Tel Aviv
 
Pretzel: optimized Machine Learning framework for low-latency and high throug...
Pretzel: optimized Machine Learning framework for low-latency and high throug...Pretzel: optimized Machine Learning framework for low-latency and high throug...
Pretzel: optimized Machine Learning framework for low-latency and high throug...NECST Lab @ Politecnico di Milano
 
Porting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to RustPorting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to RustEvan Chan
 
Algorithm analysis.pptx
Algorithm analysis.pptxAlgorithm analysis.pptx
Algorithm analysis.pptxDrBashirMSaad
 

Semelhante a Towards an Integration of the Actor Model in an FRP Language for Small-Scale Embedded Systems (20)

Threads and multi threading
Threads and multi threadingThreads and multi threading
Threads and multi threading
 
Data race
Data raceData race
Data race
 
04 performance
04 performance04 performance
04 performance
 
Hs java open_party
Hs java open_partyHs java open_party
Hs java open_party
 
Onnc intro
Onnc introOnnc intro
Onnc intro
 
Design & Analysis of Algorithm course .pptx
Design & Analysis of Algorithm course .pptxDesign & Analysis of Algorithm course .pptx
Design & Analysis of Algorithm course .pptx
 
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
 
Week1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC BeginWeek1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC Begin
 
Jvm memory model
Jvm memory modelJvm memory model
Jvm memory model
 
Pretzel: optimized Machine Learning framework for low-latency and high throug...
Pretzel: optimized Machine Learning framework for low-latency and high throug...Pretzel: optimized Machine Learning framework for low-latency and high throug...
Pretzel: optimized Machine Learning framework for low-latency and high throug...
 
Lecture1
Lecture1Lecture1
Lecture1
 
CIS3110 Winter 2016CIS3110 (Operating Systems) Assig.docx
CIS3110 Winter 2016CIS3110 (Operating Systems) Assig.docxCIS3110 Winter 2016CIS3110 (Operating Systems) Assig.docx
CIS3110 Winter 2016CIS3110 (Operating Systems) Assig.docx
 
Simple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorialSimple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorial
 
Parallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMPParallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMP
 
Strata Singapore: Gearpump Real time DAG-Processing with Akka at Scale
Strata Singapore: GearpumpReal time DAG-Processing with Akka at ScaleStrata Singapore: GearpumpReal time DAG-Processing with Akka at Scale
Strata Singapore: Gearpump Real time DAG-Processing with Akka at Scale
 
JVM Memory Model - Yoav Abrahami, Wix
JVM Memory Model - Yoav Abrahami, WixJVM Memory Model - Yoav Abrahami, Wix
JVM Memory Model - Yoav Abrahami, Wix
 
Pretzel: optimized Machine Learning framework for low-latency and high throug...
Pretzel: optimized Machine Learning framework for low-latency and high throug...Pretzel: optimized Machine Learning framework for low-latency and high throug...
Pretzel: optimized Machine Learning framework for low-latency and high throug...
 
Porting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to RustPorting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to Rust
 
A22 Introduction to DTrace by Kyle Hailey
A22 Introduction to DTrace by Kyle HaileyA22 Introduction to DTrace by Kyle Hailey
A22 Introduction to DTrace by Kyle Hailey
 
Algorithm analysis.pptx
Algorithm analysis.pptxAlgorithm analysis.pptx
Algorithm analysis.pptx
 

Último

%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 

Último (20)

%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

Towards an Integration of the Actor Model in an FRP Language for Small-Scale Embedded Systems

  • 1. Towards an Integration of the Actor Model in an FRP Language for Small-Scale Embedded Systems Takuo Watanabe & Kensuke Sawada Department of Computer Science, Tokyo Institute of Technology Oct. 30, 2016 AGERE!@SPLASH 2016 1
  • 2. About This Work • An actor-based execution model of a pure FRP languages for small-scale embedded systems • Objective - flexible execution models - open/customizable interface with higher-level abstraction • Talk Outline - EmFRP - Runtime System - Actor-Based Runtime Implementation - Future Work 2
  • 3. "Small-Scale" Embedded Systems • Resource-Constrained Systems - Processor: 8–32bit - Clock: ≤ 100MHz - Program Storage: ≤ 1M words - RAM: ≤ 1M bytes - No MMU • w/o full-fledged OS (e.g., Linux) - embedded in special purpose devices • ex) Microcontrollers - PIC, AVR, H8, ARM Cortex-M, etc. 3
  • 4. Emfrp [Sawada & Watanabe, CROW2016] • An FRP language for small-scale embedded systems - Strongly-typed, Purely functional • parametric polymorphism & type inference • algebraic data types & pattern matching - Simple abstraction for time-varying values (aka signals) • node: named, non-first-class representation • lifting-free - Bounded & predictable amount of runtime memory • syntactic restrictions & type system • github.com/sawaken/emfrp - Compiler & Interpreter (written in Ruby) • The compiler generates platform-independent ANSI-C code runnable several microcontrollers (AVR, ARM Cortex-M) 4
  • 5. Ex1: Air-Conditioner Controller in Emfrp 5 01: module ACController # module name 02: in tmp : Float, # temperature sensor 03: hmd : Float # humidity sensor 04: out ac : Bool # air-conditioner 05: use Std # standard library 06: 07: # discomfort (temperature-humidity) index 08: node di = 0.81 * tmp + 0.01 * hmd 09: * (0.99 * tmp - 14.3) + 46.3 10: 11: # air-conditioner status 12: node init[False] ac = di >= 75.0 + ho 13: 14: # hysteresis offset 15: node ho = if ac@last then -0.5 else 0.5
  • 6. History-Sensitive Behavior with @last 6 # air-conditioner status node ac = di >= 75.0 # air-conditioner status node init[False] ac = di >= 75.0 + ho # hysteresis offset node ho = if ac@last then -0.5 else 0.5 75.0 di ac 75.0 di ac Emfrp syntax for referring to the previous value of an arbitrary node (cf. foldp in Elm)
  • 7. Case Study: Digital Clock [CROW2016] • Target: mbed LPC1768 - ARM Cortex M3, 96MHz - RAM 32K, Flash 512K - LCD, 3 Buttons • Code - Emfrp: 80 loc - Glue code in C++: 45 loc - External Libraries • Compiled Code - Generated C code: 592 loc - Binary (ARM RVDS4.1) • w/o library : 2.3 KB • w/ library: 30.1 KB 7
  • 8. Related Work 8 Yampa (FRP) Elm (FRP) Céu (procedural) Simulink (dataflow) CFRP* (FRP) Emfrp (FRP) Usable for Small-Scale Embedded Systems ✕ ✕ ⃝ ⃝ ⃝ ⃝ Frist-Class Functions ⃝ ⃝ ⃝ ✕ ⃝ ✕ Algebraic Data Types & Pattern Matching ⃝ ⃝ ✕ ✕ ✕ ⃝ Declarative Programming & Referential Transparency ⃝ ⃝ ✕ △ ⃝ ⃝ Automated Unit Test ⃝ ⃝ ✕ ⃝ ✕ ⃝ Modularity & Abstractness ⃝ ⃝ △ ⃝ ⃝ ⃝ *Another FRP language developed by use in prior to Emfrp
  • 9. DAG Representation of Ex1 9 tmp (Float) hmd (Float) di (Float) ac (Bool) ho (Float) temperature sensor humidity sensor discomfort index air- conditioner air-conditioner status hysteresis offset node dependency past-value dependencynode device connection
  • 10. Push-Based Execution Model of Emfrp 10 tmp (Float) hmd (Float) di (Float) ac (Bool) ho (Float) tmp hmd di ho ac iteration The runtime system updates the values of the nodes by repeatedly evaluating them in an order compatible to the DAG.
  • 11. module ACController # module name in tmp : Float, # temperature sensor hmd : Float # humidity sensor pulse10ms : Bool # hardware interval timer (10ms) out ac : Bool, # air-conditioner led : Bool # LED use Std # standard library # discomfort (temperature-humidity) index node di = 0.81 * tmp + 0.01 * hmd * (0.99 * tmp - 14.3) + 46.3 # timer counter (resets to 0 every 1 minute) node init[0] timer = if !pulse10ms@last && pulse10ms then (timer@last + 1) % 6000 else timer@last # air-conditioner switch node ac = if timer@last != timer && timer == 0 then di >= 75.0 else ac@last # LED blinks at 1Hz node led = (timer % 100) < 50 Ex2: A Timer-Based Air-Conditioner Controller 11
  • 12. Actor-Based Execution Model • With the push-based execution model, tmp, hmd and di are evaluated in every iteration. However, the value of them required only once per minute. • In this work, we adopt an actor representation of nodes to provide flexible runtime strategies and good abstractions runtime access - one actor (implemented as a C++ object) per node - message-based dependency propagation • single dispatch queue model • transmission order preservation (a la ABCL) - customizable scheduling via reflection (GWR) • GWR = Reflection on Actor-Groups [Watanabe, AGERE2013] 12
  • 13. DAG Representation of Ex2 13 tmp (Float) hmd (Float) di (Float) ac (Bool) timer (Int) temperature sensor humidity sensor air- conditioner led (Bool) hardware timer pulse 10ms (Bool) LED
  • 14. class TMPNode : public Actor { public: TMPNode(Actor2 *di, TMPSensor *tmp); virtual ~TMPNode() {} virtual void activate(Message *m); private: Actor2 *di; TMPSensor *tmp; } void TMPNode::activate(Message *m) { di->send1(Message::floatMessage(tmp->read(), m->cust)); } class DINode : public Actor2 { public: DINode(Actor *ac) ac(ac) { ... } virtual ~DINode() {} virtual void activate(Message *m); private: Actor *ac; } void DINode::activate(Message *mt, Message *mh) { assert(mt->cust == mh->cust); float t = mt->getFloat(), h = mh->getFloat(); float di = 0.81 * t + 0.01 * h * (0.99 * t - 14.3) + 46.3; ac->send(Message::floatMessage(di, mt->cust)); } Actor-Based Representation of Nodes in Ex2 14
  • 15. Ex: Delayed (Lazy/Pull) Blocks • An expression suffixed with @delay indicates that the expression is evaluated only when it is required. • Nodes in a delayed block and their dependent nodes are evaluated in a separate actor group that is activated only when it is needed. 15 # air-conditioner switch node ac = if timer@last != timer && timer == 0 then (di >= 75.0)@delay else ac@last
  • 16. The Actor-Group for the Delayed Block • Actors in the group for the delayed block is detached from the main iteration path. - They have separate message queue. • The detached actor group is activated by sending an activation message from ac when they are needed. 16 tmp (Float) hmd (Float) di (Float) ac (Bool) timer (Int) led (Bool) pulse 10ms (Bool)
  • 17. class DINode : public Actor2 { ... } void DINode::activate(Message *mt, Message *mh) { float t = mt->getFloat(), h = mh->getFloat(); float di = 0.81 * t + 0.01 * h * (0.99 * t - 14.3) + 46.3; mt->cust->send(mkFloatMessage(di, mt->cust)); } class ACNode : public Actor { ... } void ACNode::activate(Message *m) { if (m->prevInt() != m->getInt() && m->getInt() == 0) { acDelayedBlockGroup->send(Message::unitMessage(&acDelayedBlock)); } } class ACDelayedBlock : public Actor { ...} void ACDelayedBlock::activate(Message *m) { m->cust->send( Message::booleanMessage(m->getFloat() > 75.0, m->cust)); } 17
  • 18. Summary & Future Work • Proposed an actor-based execution model of Emfrp. - actor representation of nodes (time-varying values) - GWR for flexible execution strategies • Future Work - Possible Applications • Asynchronous (Future) Node - heavy node / slow peripheral devices / inter-device communication • Group-Wide Iteration Control - periodical iteration / deep sleep mode / interrupts from devices • Actors as signal values - Relationship to other concurrent / event models - Better (meta-level) interface - Implementation 18