SlideShare a Scribd company logo
1 of 30
1ni.com
ni.com
ni.com
Spaghetti and Shared Variables
Jordan McBain, Ph.D., CLA
Dynamic Reactor Pattern for Distributed Systems in Control and Monitoring
4ni.com
Brose North America, Inc.
Mechatronic Systems and Drives forAutomobiles
Structures and components for vehicle seats
Systems for engine cooling,
electric motors and drives
Modules and
components
for vehicle doors
5ni.com
Spaghetti and Shared Variables
• Shared Variables are great for their designed use case, BUT
• Typical usage leads to “Spaghetti and Shared Variables”
• Building a large scale application needs more
o Service Oriented Architectures
o Open Standards (e.g. MIMOSA)
• Object Oriented Design Pattern
• Dynamic “Reactor Pattern” for LabVIEW
• Queue, FIFO, etc. instead of “pointers” to callbacks
• Online subscription to “published variables”
• Dynamic online creation of “published variables”
6ni.com
Shared Variables
NI’s perspective
7ni.com
Design Iterations
• Presented at South-East Michigan User Group Meeting (Dec 2014)
• Very rough sketch
• Deficiencies:
o Strings to help identify published variables
– Inefficient string comparisons
o Static published variable creation/destruction
– Or at least introducing potential for blocking
o Not ready for large scale application
o No consideration given to streaming
• Today’s presentation resolves most of these issues
8ni.com
Object-Oriented Paradigm
The Class
Class – “software module”
◦ A rigid interface specification
◦ Encapsulation
◦ Information Hiding
DataA: uint32
DataB: UserClass
[A,B]=MyFunc1(uint32, bool, dbl)
[E]=MyFunc2(bool, classA)
Class A
“struct”
Or cluster
Acces
Routines
(bunch o’
VI’s)
9ni.com
Object-Oriented Paradigm
Inheritance & Polymorphism
DataA: uint32
DataB: UserClass
Data:bool
Data1: int32
[A,B]=MyFunc1(uint32, bool, dbl)
[E]=MyFunc2(bool, classA)
[A]=MyFunc3(bool, dbl)
[E]=MyFunc4(bool, dbl)
Class D
Data: bool
[A]=MyFunc3(bool, dbl)
Class B
Data1: int32
DataA: uint32
DataB: UserClass
[E]=MyFunc4(bool, dbl)
[A,B]=MyFunc1(uint32, bool, dbl)
[E]=MyFunc2(bool, classA)
Class C
DataA: uint32
DataB: UserClass
[A,B]=MyFunc1(uint32, bool, dbl)
[E]=MyFunc2(bool, classA)
Class A
Multiple
Inheritance
Not Supported
In LabVIEW
10ni.com
Multi-Threaded Environment
Central Error
Handling
Publish:
- Error State
- Error Event
Logging
Publish:
- Logged Channel IDs
- Logging Rate
Channel Manager
Publish:
- Channel IDs
- Available Algorithms
- Available Libraries
BroadcasterProcess A
Publish:
- Process A_1
- Process A_2
Can I log error
events? Please!?
User Interface
Also I’d like to know
about Process A_1
Geez. I’d like to know about
available algorithms
Reuse note: Libraries Publish algorithms
Also, tell me about error
states!
I’d like to tell the Channel
manager to add an algorithm too
Publish:
- Run State
What is the run state?
May I assist
coordination?
11ni.com
Error
Handling
Logging Channel
Manager
Broadcaster Process A
CRIO1
Error
Handling
Logging Channel
Manager
Broadcaster Process B
CRIO2
GUI
Broadcaster
Central
Error
Handling
Central
Logging GUI
Hello, CRIO1
here! Anyone
out there?
Yup! CRIO 2
here!
CRIO1 &CRIO2,
I’m the GUI!
I want to be
everyone’s boss!
No way! We
don’t need
servers.
Let’s just be
peers!
12ni.com
Reactor Pattern
• Application should only block on a single
source of events
• Avoid context switching and synchronization
• Adding new services and published
variables should be easy
• Shield application code from complexity of
multi-threading & synchronization
[POSA2, 1999]
Four forces:
13ni.com
Reactor Pattern
• Synchronously wait on events from multiple sources
• Integrate demultiplexing and dispatching events to processing services
• Decouple event demultiplexing/dispatching from application-specific
processing
[POSA2, 1999]
Solution
14ni.com
Reactor Pattern
• Reactor class allows registration & removal of event handlers
• Reactor waits on a group of operating system mechanisms
• E.g. Files, sockets, etc.
• When OS mechanism triggers Reactor, the Reactor
• Looks up event handlers registered for that event
• Calls the handler’s call back via a “pointer” to the handler
o In LabVIEW a Data Value Reference
• Nice pattern for single threaded applications BUT for parallel apps:
Implementation Limitations
• Race Conditions
• Deadlock
• Non-preemptive
• Debugging
15ni.com
Design Problem
• In a multi-threaded environment,
threads may:
• Have data other threads want
• Want to know data from other
threads
• In a distributed environment, distributed
threads may:
• Have data other distributed threads want
• Want to know data from other distributed
threads
The same problem!
Possibly occurring at the same time!
Reuse Potential!
16ni.com
Problem Abstraction: Design Pattern
Broadcaster
Service
Hi, I am a
service
named
<????>
I will have
variables I want to
publish throughout
my life time
I will want to subscribe and
unsubscribe to other
variables during my life
time
Send me updates about other
variables via this COM scheme
Ok. No Problem. Tell me what
you want to know about via this
COM scheme
Service Service
Network
Broadcaster
Service
Service
Service
Let’s abstract network
(EtherNet, CAN, etc.)
details for our
services
17ni.com
Participants
• Data storage class
• Applications will create new ones to handle individual needs
• Must be registered to an aggregator to be of any use
• When aggregator is registered to broadcaster:
o Services can subscribe to receive information feeds
o Services can request to write to published variables
PublishedVariable
18ni.com
Participants
• Stores (“Aggregates”) Published Variables
• When a variable is updated, transmits to Broadcaster for dispersion
o Only transmits to Broadcaster with active subscriptions
• Service class inherits this
o So it can be both an Aggregator and a subscriber
Published Variable Aggregator
19ni.com
Participants
• Passes data between services depending on registration
• Network and Concurrency Abstraction Layer
Published Variable Broadcaster
Broadcaster
20ni.com
Participants
• Inherits Published Variable Broadcaster
• Interface hides COM scheme (e.g. queue)
• Transmits command objects to actual Broadcaster for processing
• COM Scheme transmits each operation’s parameters to only Broadcaster
• Inversion of control
• Each command object:
o Has a “Receiver” access routine that is friended to Broadcaster
• When Broadcaster receives object:
o Calls this “Receiver” and passes itself to the “Receiver”
o The Receiver calls the appropriate method in Broadcaster to get the work
done
Distributed Published Variable Broadcaster
Broadcaster
21ni.com
Participants
• PV Aggregator
• Hidden inside Broadcaster’s “Run Routine”
• Sends UDP multicast message announcing presence
• Has a published variable acting as a queue for newly discovered IP’s
PV Broadcaster: Multicaster
22ni.com
Participants
• Service (Subscriber + Aggregator)
• Subscribes to Multicaster’s “Discovered IP” PV
• Attempts to setup communication, if successful:
• Publishes this as “Registered IP” PV
o Multicaster subscribed
• Asynchronously launches an aggregator to represent all aggregator’s on
the distributed computer
o Think: Actor Framework
• Design Decision: Polls all “Registered IP’s” via TCP
• Makes local subscriptions for “Registered IP’s” and transmit via TCP
PV Broadcaster: Network Facade
23ni.com
Participants
• Abstracts the communication transmission/reception mechanism
• Choice of actual mechanism initialized on “Init()”
• Otherwise interface between child classes is the same
• Options
• User Events
• Queues
• FIFO’s
• Actor Framework “Queues”?
COM Scheme
24ni.com
Participants
• Objective for threads to block only on one source
o Must generalize the data type transmitted via communication scheme
• Child classes
o Broadcaster Configuration Settings
– Published Variables
o Aggregator Configuration Settings
• Configuration Settings
o Permits registration/deregistration of services and published variables
– Via communication scheme hidden behind interface
COM Element
25ni.com
26ni.com
Inversion of Control
• “The Hollywood Principle”
• Don’t Call Us, We Will Call You
• Like the Actor Framework
• Opportunity to use “Friends” and “Community Scope” in LabVIEW
• Communication Elements have method for Broadcaster & Aggregator
• Once called, they choose appropriate Method in Broadcaster/Aggregator
• Avoid if/thens and avoid BAD code:
27ni.com
Re-Use Potential
• Reuse between projects
• Reuse within the same project
• Example: Recursive use of “Aggregator Concept”
• Make “Channel Manager” an aggregator
o Channels in channel manager are also aggregators
o Channel manager runs in single thread of excecution
o Change messaging scheme to array based scheme
28ni.com
Future
• Message priorities
• Urgent messages
• Bit masked numeric id for VarID
• Aggr Details: Allow recursive AggrID
• Integration with Actor Framework
• Other Network Types
• CANopen, EtherCAT, etc.
• Streaming
Bit 0Bit NBit N+m
VarIDAggr IDBroadCasterID Aggr Details
Bit N+m+o
29ni.com
Conclusions
30ni.com

More Related Content

Viewers also liked

Инструменты развития личностного потенциала персонала компании
Инструменты развития личностного потенциала персонала компанииИнструменты развития личностного потенциала персонала компании
Инструменты развития личностного потенциала персонала компанииGrow Group Сonsulting
 
Award winning Sales Pitch
Award winning Sales PitchAward winning Sales Pitch
Award winning Sales PitchAkin Akinboyewa
 
Erik Ohlsson_Thesis_Lund University
Erik Ohlsson_Thesis_Lund UniversityErik Ohlsson_Thesis_Lund University
Erik Ohlsson_Thesis_Lund UniversityErik Ohlsson
 
An Unexpected Way to Grow Your Brand's Awareness
An Unexpected Way to Grow Your Brand's AwarenessAn Unexpected Way to Grow Your Brand's Awareness
An Unexpected Way to Grow Your Brand's AwarenessUniverse
 
Resume_Certificates
Resume_CertificatesResume_Certificates
Resume_CertificatesDamian Lyons
 
Môj psík-Dianka
Môj psík-DiankaMôj psík-Dianka
Môj psík-Diankairenkolcak
 
Shell button catalogue
Shell button catalogueShell button catalogue
Shell button catalogueLee Jessie
 
Shipping container homes Benefits
Shipping container homes Benefits Shipping container homes Benefits
Shipping container homes Benefits SCF Containers
 
TechSaints International Pvt. Ltd. - Technology Company Presentation.
TechSaints International Pvt. Ltd. - Technology Company Presentation.TechSaints International Pvt. Ltd. - Technology Company Presentation.
TechSaints International Pvt. Ltd. - Technology Company Presentation.Rohit Gupta
 
How to Boost Revenue with a More Strategic Sales Compensation Plan
How to Boost Revenue with a More Strategic Sales Compensation PlanHow to Boost Revenue with a More Strategic Sales Compensation Plan
How to Boost Revenue with a More Strategic Sales Compensation PlanCornerstone Software, Inc.
 
Tupac presentation
Tupac presentationTupac presentation
Tupac presentationRoyce Rowan
 

Viewers also liked (16)

Инструменты развития личностного потенциала персонала компании
Инструменты развития личностного потенциала персонала компанииИнструменты развития личностного потенциала персонала компании
Инструменты развития личностного потенциала персонала компании
 
Award winning Sales Pitch
Award winning Sales PitchAward winning Sales Pitch
Award winning Sales Pitch
 
Erik Ohlsson_Thesis_Lund University
Erik Ohlsson_Thesis_Lund UniversityErik Ohlsson_Thesis_Lund University
Erik Ohlsson_Thesis_Lund University
 
S J Pieterse CV 2016
S J Pieterse CV 2016S J Pieterse CV 2016
S J Pieterse CV 2016
 
An Unexpected Way to Grow Your Brand's Awareness
An Unexpected Way to Grow Your Brand's AwarenessAn Unexpected Way to Grow Your Brand's Awareness
An Unexpected Way to Grow Your Brand's Awareness
 
ARTICULO_sin trazar
ARTICULO_sin trazarARTICULO_sin trazar
ARTICULO_sin trazar
 
Resume_Certificates
Resume_CertificatesResume_Certificates
Resume_Certificates
 
SusanAustinResume
SusanAustinResumeSusanAustinResume
SusanAustinResume
 
Môj psík-Dianka
Môj psík-DiankaMôj psík-Dianka
Môj psík-Dianka
 
Shell button catalogue
Shell button catalogueShell button catalogue
Shell button catalogue
 
Shipping container homes Benefits
Shipping container homes Benefits Shipping container homes Benefits
Shipping container homes Benefits
 
TechSaints International Pvt. Ltd. - Technology Company Presentation.
TechSaints International Pvt. Ltd. - Technology Company Presentation.TechSaints International Pvt. Ltd. - Technology Company Presentation.
TechSaints International Pvt. Ltd. - Technology Company Presentation.
 
How to Boost Revenue with a More Strategic Sales Compensation Plan
How to Boost Revenue with a More Strategic Sales Compensation PlanHow to Boost Revenue with a More Strategic Sales Compensation Plan
How to Boost Revenue with a More Strategic Sales Compensation Plan
 
Tupac presentation
Tupac presentationTupac presentation
Tupac presentation
 
3.1. wout baert
3.1. wout baert3.1. wout baert
3.1. wout baert
 
PayLeap _ PROcillo 1
PayLeap _ PROcillo 1PayLeap _ PROcillo 1
PayLeap _ PROcillo 1
 

Similar to Dynamic Reactor Pattern for Distributed Systems in Control and Monitoring

Foundational Design Patterns for Multi-Purpose Applications
Foundational Design Patterns for Multi-Purpose ApplicationsFoundational Design Patterns for Multi-Purpose Applications
Foundational Design Patterns for Multi-Purpose ApplicationsChing-Hwa Yu
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsRonny López
 
HPC Controls Future
HPC Controls FutureHPC Controls Future
HPC Controls Futurercastain
 
Managing infrastructure with Application Policy by Mike Cohen
Managing infrastructure with Application Policy by Mike CohenManaging infrastructure with Application Policy by Mike Cohen
Managing infrastructure with Application Policy by Mike Cohenbuildacloud
 
Realtime Applications with Laravel - LaravelLive India Online Meetup Jun 2020
Realtime Applications with Laravel - LaravelLive India Online Meetup Jun 2020Realtime Applications with Laravel - LaravelLive India Online Meetup Jun 2020
Realtime Applications with Laravel - LaravelLive India Online Meetup Jun 2020Mitul Golakiya
 
API310 - How to refactor a monolith to serverless in 8 steps
API310 - How to refactor a monolith to serverless in 8 stepsAPI310 - How to refactor a monolith to serverless in 8 steps
API310 - How to refactor a monolith to serverless in 8 stepsYan Cui
 
Dubbo and Weidian's practice on micro-service architecture
Dubbo and Weidian's practice on micro-service architectureDubbo and Weidian's practice on micro-service architecture
Dubbo and Weidian's practice on micro-service architectureHuxing Zhang
 
OpenDaylight Update (June 2018)
OpenDaylight Update (June 2018)OpenDaylight Update (June 2018)
OpenDaylight Update (June 2018)Michelle Holley
 
Crafting Consumable APIs
Crafting Consumable APIsCrafting Consumable APIs
Crafting Consumable APIsWSO2
 
QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes Abdul Basit Munda
 
Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019Ram Vennam
 
Kubernetes on the Edge / 在邊緣的K8S
Kubernetes on the Edge / 在邊緣的K8SKubernetes on the Edge / 在邊緣的K8S
Kubernetes on the Edge / 在邊緣的K8SYi-Fu Ciou
 
Cloud Foundry Technical Overview at IBM Interconnect 2016
Cloud Foundry Technical Overview at IBM Interconnect 2016Cloud Foundry Technical Overview at IBM Interconnect 2016
Cloud Foundry Technical Overview at IBM Interconnect 2016Stormy Peters
 
Incremental Queries and Transformations for Engineering Critical Systems
Incremental Queries and Transformations for Engineering Critical SystemsIncremental Queries and Transformations for Engineering Critical Systems
Incremental Queries and Transformations for Engineering Critical SystemsÁkos Horváth
 
1200 wsrr & iib - advanced integration - final
1200   wsrr & iib - advanced integration - final1200   wsrr & iib - advanced integration - final
1200 wsrr & iib - advanced integration - finalsmithson.martin
 
Patterns of Distributed Application Design
Patterns of Distributed Application DesignPatterns of Distributed Application Design
Patterns of Distributed Application DesignOrkhan Gasimov
 

Similar to Dynamic Reactor Pattern for Distributed Systems in Control and Monitoring (20)

Foundational Design Patterns for Multi-Purpose Applications
Foundational Design Patterns for Multi-Purpose ApplicationsFoundational Design Patterns for Multi-Purpose Applications
Foundational Design Patterns for Multi-Purpose Applications
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP Applications
 
HPC Controls Future
HPC Controls FutureHPC Controls Future
HPC Controls Future
 
Small Cells Service
Small Cells ServiceSmall Cells Service
Small Cells Service
 
Open access network
Open access networkOpen access network
Open access network
 
Managing infrastructure with Application Policy by Mike Cohen
Managing infrastructure with Application Policy by Mike CohenManaging infrastructure with Application Policy by Mike Cohen
Managing infrastructure with Application Policy by Mike Cohen
 
Colt inter-provider SDN NNIs and APIs
Colt inter-provider SDN NNIs and APIsColt inter-provider SDN NNIs and APIs
Colt inter-provider SDN NNIs and APIs
 
Realtime Applications with Laravel - LaravelLive India Online Meetup Jun 2020
Realtime Applications with Laravel - LaravelLive India Online Meetup Jun 2020Realtime Applications with Laravel - LaravelLive India Online Meetup Jun 2020
Realtime Applications with Laravel - LaravelLive India Online Meetup Jun 2020
 
Microservices.pdf
Microservices.pdfMicroservices.pdf
Microservices.pdf
 
API310 - How to refactor a monolith to serverless in 8 steps
API310 - How to refactor a monolith to serverless in 8 stepsAPI310 - How to refactor a monolith to serverless in 8 steps
API310 - How to refactor a monolith to serverless in 8 steps
 
Dubbo and Weidian's practice on micro-service architecture
Dubbo and Weidian's practice on micro-service architectureDubbo and Weidian's practice on micro-service architecture
Dubbo and Weidian's practice on micro-service architecture
 
OpenDaylight Update (June 2018)
OpenDaylight Update (June 2018)OpenDaylight Update (June 2018)
OpenDaylight Update (June 2018)
 
Crafting Consumable APIs
Crafting Consumable APIsCrafting Consumable APIs
Crafting Consumable APIs
 
QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes
 
Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019
 
Kubernetes on the Edge / 在邊緣的K8S
Kubernetes on the Edge / 在邊緣的K8SKubernetes on the Edge / 在邊緣的K8S
Kubernetes on the Edge / 在邊緣的K8S
 
Cloud Foundry Technical Overview at IBM Interconnect 2016
Cloud Foundry Technical Overview at IBM Interconnect 2016Cloud Foundry Technical Overview at IBM Interconnect 2016
Cloud Foundry Technical Overview at IBM Interconnect 2016
 
Incremental Queries and Transformations for Engineering Critical Systems
Incremental Queries and Transformations for Engineering Critical SystemsIncremental Queries and Transformations for Engineering Critical Systems
Incremental Queries and Transformations for Engineering Critical Systems
 
1200 wsrr & iib - advanced integration - final
1200   wsrr & iib - advanced integration - final1200   wsrr & iib - advanced integration - final
1200 wsrr & iib - advanced integration - final
 
Patterns of Distributed Application Design
Patterns of Distributed Application DesignPatterns of Distributed Application Design
Patterns of Distributed Application Design
 

More from Jordan McBain

Object oriented design patterns for distributed systems
Object oriented design patterns for distributed systemsObject oriented design patterns for distributed systems
Object oriented design patterns for distributed systemsJordan McBain
 
Condition Monitoring of Variable Speed Machinery
Condition Monitoring of Variable Speed MachineryCondition Monitoring of Variable Speed Machinery
Condition Monitoring of Variable Speed MachineryJordan McBain
 
Principal Component Analysis For Novelty Detection
Principal Component Analysis For Novelty DetectionPrincipal Component Analysis For Novelty Detection
Principal Component Analysis For Novelty DetectionJordan McBain
 
Software Architecture For Condition Monitoring Of Mobile Underground
Software Architecture For Condition Monitoring Of Mobile UndergroundSoftware Architecture For Condition Monitoring Of Mobile Underground
Software Architecture For Condition Monitoring Of Mobile UndergroundJordan McBain
 
Condition Monitoring Of Unsteadily Operating Equipment
Condition Monitoring Of Unsteadily Operating EquipmentCondition Monitoring Of Unsteadily Operating Equipment
Condition Monitoring Of Unsteadily Operating EquipmentJordan McBain
 
CBM Variable Speed Machinery
CBM Variable Speed MachineryCBM Variable Speed Machinery
CBM Variable Speed MachineryJordan McBain
 
Condition Monitoring of Variable State Machinery
Condition Monitoring of Variable State MachineryCondition Monitoring of Variable State Machinery
Condition Monitoring of Variable State MachineryJordan McBain
 

More from Jordan McBain (7)

Object oriented design patterns for distributed systems
Object oriented design patterns for distributed systemsObject oriented design patterns for distributed systems
Object oriented design patterns for distributed systems
 
Condition Monitoring of Variable Speed Machinery
Condition Monitoring of Variable Speed MachineryCondition Monitoring of Variable Speed Machinery
Condition Monitoring of Variable Speed Machinery
 
Principal Component Analysis For Novelty Detection
Principal Component Analysis For Novelty DetectionPrincipal Component Analysis For Novelty Detection
Principal Component Analysis For Novelty Detection
 
Software Architecture For Condition Monitoring Of Mobile Underground
Software Architecture For Condition Monitoring Of Mobile UndergroundSoftware Architecture For Condition Monitoring Of Mobile Underground
Software Architecture For Condition Monitoring Of Mobile Underground
 
Condition Monitoring Of Unsteadily Operating Equipment
Condition Monitoring Of Unsteadily Operating EquipmentCondition Monitoring Of Unsteadily Operating Equipment
Condition Monitoring Of Unsteadily Operating Equipment
 
CBM Variable Speed Machinery
CBM Variable Speed MachineryCBM Variable Speed Machinery
CBM Variable Speed Machinery
 
Condition Monitoring of Variable State Machinery
Condition Monitoring of Variable State MachineryCondition Monitoring of Variable State Machinery
Condition Monitoring of Variable State Machinery
 

Recently uploaded

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
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
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 

Recently uploaded (20)

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
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
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 

Dynamic Reactor Pattern for Distributed Systems in Control and Monitoring

  • 3. ni.com Spaghetti and Shared Variables Jordan McBain, Ph.D., CLA Dynamic Reactor Pattern for Distributed Systems in Control and Monitoring
  • 4. 4ni.com Brose North America, Inc. Mechatronic Systems and Drives forAutomobiles Structures and components for vehicle seats Systems for engine cooling, electric motors and drives Modules and components for vehicle doors
  • 5. 5ni.com Spaghetti and Shared Variables • Shared Variables are great for their designed use case, BUT • Typical usage leads to “Spaghetti and Shared Variables” • Building a large scale application needs more o Service Oriented Architectures o Open Standards (e.g. MIMOSA) • Object Oriented Design Pattern • Dynamic “Reactor Pattern” for LabVIEW • Queue, FIFO, etc. instead of “pointers” to callbacks • Online subscription to “published variables” • Dynamic online creation of “published variables”
  • 7. 7ni.com Design Iterations • Presented at South-East Michigan User Group Meeting (Dec 2014) • Very rough sketch • Deficiencies: o Strings to help identify published variables – Inefficient string comparisons o Static published variable creation/destruction – Or at least introducing potential for blocking o Not ready for large scale application o No consideration given to streaming • Today’s presentation resolves most of these issues
  • 8. 8ni.com Object-Oriented Paradigm The Class Class – “software module” ◦ A rigid interface specification ◦ Encapsulation ◦ Information Hiding DataA: uint32 DataB: UserClass [A,B]=MyFunc1(uint32, bool, dbl) [E]=MyFunc2(bool, classA) Class A “struct” Or cluster Acces Routines (bunch o’ VI’s)
  • 9. 9ni.com Object-Oriented Paradigm Inheritance & Polymorphism DataA: uint32 DataB: UserClass Data:bool Data1: int32 [A,B]=MyFunc1(uint32, bool, dbl) [E]=MyFunc2(bool, classA) [A]=MyFunc3(bool, dbl) [E]=MyFunc4(bool, dbl) Class D Data: bool [A]=MyFunc3(bool, dbl) Class B Data1: int32 DataA: uint32 DataB: UserClass [E]=MyFunc4(bool, dbl) [A,B]=MyFunc1(uint32, bool, dbl) [E]=MyFunc2(bool, classA) Class C DataA: uint32 DataB: UserClass [A,B]=MyFunc1(uint32, bool, dbl) [E]=MyFunc2(bool, classA) Class A Multiple Inheritance Not Supported In LabVIEW
  • 10. 10ni.com Multi-Threaded Environment Central Error Handling Publish: - Error State - Error Event Logging Publish: - Logged Channel IDs - Logging Rate Channel Manager Publish: - Channel IDs - Available Algorithms - Available Libraries BroadcasterProcess A Publish: - Process A_1 - Process A_2 Can I log error events? Please!? User Interface Also I’d like to know about Process A_1 Geez. I’d like to know about available algorithms Reuse note: Libraries Publish algorithms Also, tell me about error states! I’d like to tell the Channel manager to add an algorithm too Publish: - Run State What is the run state? May I assist coordination?
  • 11. 11ni.com Error Handling Logging Channel Manager Broadcaster Process A CRIO1 Error Handling Logging Channel Manager Broadcaster Process B CRIO2 GUI Broadcaster Central Error Handling Central Logging GUI Hello, CRIO1 here! Anyone out there? Yup! CRIO 2 here! CRIO1 &CRIO2, I’m the GUI! I want to be everyone’s boss! No way! We don’t need servers. Let’s just be peers!
  • 12. 12ni.com Reactor Pattern • Application should only block on a single source of events • Avoid context switching and synchronization • Adding new services and published variables should be easy • Shield application code from complexity of multi-threading & synchronization [POSA2, 1999] Four forces:
  • 13. 13ni.com Reactor Pattern • Synchronously wait on events from multiple sources • Integrate demultiplexing and dispatching events to processing services • Decouple event demultiplexing/dispatching from application-specific processing [POSA2, 1999] Solution
  • 14. 14ni.com Reactor Pattern • Reactor class allows registration & removal of event handlers • Reactor waits on a group of operating system mechanisms • E.g. Files, sockets, etc. • When OS mechanism triggers Reactor, the Reactor • Looks up event handlers registered for that event • Calls the handler’s call back via a “pointer” to the handler o In LabVIEW a Data Value Reference • Nice pattern for single threaded applications BUT for parallel apps: Implementation Limitations • Race Conditions • Deadlock • Non-preemptive • Debugging
  • 15. 15ni.com Design Problem • In a multi-threaded environment, threads may: • Have data other threads want • Want to know data from other threads • In a distributed environment, distributed threads may: • Have data other distributed threads want • Want to know data from other distributed threads The same problem! Possibly occurring at the same time! Reuse Potential!
  • 16. 16ni.com Problem Abstraction: Design Pattern Broadcaster Service Hi, I am a service named <????> I will have variables I want to publish throughout my life time I will want to subscribe and unsubscribe to other variables during my life time Send me updates about other variables via this COM scheme Ok. No Problem. Tell me what you want to know about via this COM scheme Service Service Network Broadcaster Service Service Service Let’s abstract network (EtherNet, CAN, etc.) details for our services
  • 17. 17ni.com Participants • Data storage class • Applications will create new ones to handle individual needs • Must be registered to an aggregator to be of any use • When aggregator is registered to broadcaster: o Services can subscribe to receive information feeds o Services can request to write to published variables PublishedVariable
  • 18. 18ni.com Participants • Stores (“Aggregates”) Published Variables • When a variable is updated, transmits to Broadcaster for dispersion o Only transmits to Broadcaster with active subscriptions • Service class inherits this o So it can be both an Aggregator and a subscriber Published Variable Aggregator
  • 19. 19ni.com Participants • Passes data between services depending on registration • Network and Concurrency Abstraction Layer Published Variable Broadcaster Broadcaster
  • 20. 20ni.com Participants • Inherits Published Variable Broadcaster • Interface hides COM scheme (e.g. queue) • Transmits command objects to actual Broadcaster for processing • COM Scheme transmits each operation’s parameters to only Broadcaster • Inversion of control • Each command object: o Has a “Receiver” access routine that is friended to Broadcaster • When Broadcaster receives object: o Calls this “Receiver” and passes itself to the “Receiver” o The Receiver calls the appropriate method in Broadcaster to get the work done Distributed Published Variable Broadcaster Broadcaster
  • 21. 21ni.com Participants • PV Aggregator • Hidden inside Broadcaster’s “Run Routine” • Sends UDP multicast message announcing presence • Has a published variable acting as a queue for newly discovered IP’s PV Broadcaster: Multicaster
  • 22. 22ni.com Participants • Service (Subscriber + Aggregator) • Subscribes to Multicaster’s “Discovered IP” PV • Attempts to setup communication, if successful: • Publishes this as “Registered IP” PV o Multicaster subscribed • Asynchronously launches an aggregator to represent all aggregator’s on the distributed computer o Think: Actor Framework • Design Decision: Polls all “Registered IP’s” via TCP • Makes local subscriptions for “Registered IP’s” and transmit via TCP PV Broadcaster: Network Facade
  • 23. 23ni.com Participants • Abstracts the communication transmission/reception mechanism • Choice of actual mechanism initialized on “Init()” • Otherwise interface between child classes is the same • Options • User Events • Queues • FIFO’s • Actor Framework “Queues”? COM Scheme
  • 24. 24ni.com Participants • Objective for threads to block only on one source o Must generalize the data type transmitted via communication scheme • Child classes o Broadcaster Configuration Settings – Published Variables o Aggregator Configuration Settings • Configuration Settings o Permits registration/deregistration of services and published variables – Via communication scheme hidden behind interface COM Element
  • 26. 26ni.com Inversion of Control • “The Hollywood Principle” • Don’t Call Us, We Will Call You • Like the Actor Framework • Opportunity to use “Friends” and “Community Scope” in LabVIEW • Communication Elements have method for Broadcaster & Aggregator • Once called, they choose appropriate Method in Broadcaster/Aggregator • Avoid if/thens and avoid BAD code:
  • 27. 27ni.com Re-Use Potential • Reuse between projects • Reuse within the same project • Example: Recursive use of “Aggregator Concept” • Make “Channel Manager” an aggregator o Channels in channel manager are also aggregators o Channel manager runs in single thread of excecution o Change messaging scheme to array based scheme
  • 28. 28ni.com Future • Message priorities • Urgent messages • Bit masked numeric id for VarID • Aggr Details: Allow recursive AggrID • Integration with Actor Framework • Other Network Types • CANopen, EtherCAT, etc. • Streaming Bit 0Bit NBit N+m VarIDAggr IDBroadCasterID Aggr Details Bit N+m+o

Editor's Notes

  1. 4