the component interaction domain: modeling event-driven and demand-driven applications

18
h Biennial Ptolemy Miniconference erkeley, CA, May 9, 2003 The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications Xiaojun Liu Yang Zhao

Upload: makara

Post on 08-Jan-2016

48 views

Category:

Documents


0 download

DESCRIPTION

The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications. Xiaojun Liu Yang Zhao. Outline. Interaction between Software Components Software Framework Examples The CORBA Event Service The Click Modular Router The Component Interaction (CI) Domain Demonstration - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

5th Biennial Ptolemy MiniconferenceBerkeley, CA, May 9, 2003

The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Xiaojun LiuYang Zhao

Page 2: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 2

Outline

• Interaction between Software Components

• Software Framework Examples– The CORBA Event Service– The Click Modular Router

• The Component Interaction (CI) Domain• Demonstration• Current Status and Future Work

Page 3: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 3

Aspects of Component Interaction

• Making sense of the information exchanged– E.g. a pure event notification, or an array of

floating-point numbers– Managed by the type system

• The communication protocol– E.g. rendezvous, or read from/write to a

FIFO queue– Managed by a model of computation

Page 4: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 4

Aspects of Component Interaction

• Initiation– Which participant initiates the interaction?– What components can initiate interaction?

• Control flow– How do interacting components obtain the

execution context?

• Timing…

Page 5: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 5

The CORBA Event Service

• Support asynchronous, decoupled communication between objects

PushConsumer

+push(data : in any)+disconnect_push_consumer()

PushSupplier

+disconnect_push_supplier()

PullConsumer

+disconnect_pull_consumer()

PullSupplier

+disconnect_pull_supplier()+pull() : any+try_pull(has_event : out boolean) : any

ProxyPushConsumer

+connect_push_supplier(push_supplier : PushSupplier)

ProxyPullSupplier

+connect_pull_consumer(pull_consumer : PullConsumer)

ProxyPullConsumer

+connect_pull_supplier(pull_supplier : PullSupplier)

ProxyPushSupplier

+connect_push_consumer(push_consumer : PushConsumer)

ConsumerAdmin

+obtain_push_supplier() : ProxyPushSupplier+obtain_pull_supplier() : ProxyPullSupplier

SupplierAdmin

+obtain_push_consumer() : ProxyPushConsumer+obtain_pull_consumer() : ProxyPullConsumer

EventChannel

+for_consumers() : ConsumerAdmin+for_suppliers() : SupplierAdmin

Page 6: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 6

The Push Model

• The supplier initiates the transfer of data• The consumer reacts to supplied data• The event channel provides the execution

context for the consumer

EventChannel

EventChannel

Supplier

Supplier push()

push()

Consumer

Consumer

Consumer

push()

push()

push()

Page 7: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 7

The Pull Model

• The consumer initiates the transfer of data• The supplier reacts to demand of data• The event channel provides the execution

context for the supplier

EventChannel

EventChannel

Supplier

Supplier pull()

pull()

Consumer

Consumer

Consumer

pull()

pull()

pull()

Page 8: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 8

• Push supplier and pull consumer– The event channel acts as an event queue

• Pull supplier and push consumer– The event channel must act as an active

mediator for any interaction to take place

Mixed Models

EventChann

el

EventChann

el

Supplierpush()

Consumerpull()

EventChann

el

EventChann

el

Supplier push() Consumerpull()

Page 9: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 9

Complex Mixture

EventChann

el

EventChann

el

EventChann

el

EventChann

el

EventChann

el

EventChann

el

EventChann

el

EventChann

el

Supplier

Supplier

Supplier

Consumer

Consumer

Consumer

Supplier/Consumer

Supplier/Consumer

Supplier/Consumer

Supplier/Consumer

push()

push()

pull() pull()

push() push()

push()

push()

pull()

pull()

push()

pull()pull()

pull()

pull()

Page 10: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 10

The Click Modular Router

• Elements are C++ objects that interact by making method calls

• Packets are passed as method argument or return value

• Flexible, configurable, and highly efficient routers have been built with this software architecture

E. Kohler et al., “The Click Modular Router,” ACM Transactions on Computer Systems, 18(3), August 2000, pages 263-297.

Page 11: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 11

The Component Interaction Domain

• Push/pull interaction• Active/passive actors• Multi-threaded execution

Page 12: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 12

Push/Pull Interaction

• Push model– Event-driven applications

• Pull model– Demand-driven applications

Page 13: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 13

Active Actors

• Active actors initiate all computation in the model– Source actors with

push output– Sink actors with

pull input– Actors with pull

input and push output

Page 14: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 14

Passive Actors

• Passive actors react to pushed event or pull demand

Page 15: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 15

Multi-Threaded Execution

• Each active actor has its own execution thread

• Passive actors share the same execution thread as the director

Page 16: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 16

A Router Model in the CI Domain

Page 17: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 17

CI vs. the Click Router Architecture

• Click is a specialized, highly efficient, runtime software architecture based on object-oriented programming. Router elements interact by making method calls. The control flow is fixed once the router is built.

• The CI domain provides a more general model architecture based on actor-oriented programming. Actor interaction is mediated by the director, so is more decoupled. The director (or code generator) can partition a model and choose a different analysis/scheduling strategy for each part.

Page 18: The Component Interaction Domain: Modeling Event-Driven and Demand-Driven Applications

Ptolemy Miniconference 18

Current Status and Future Work

• Current status– A preliminary implementation is included in

the current release

• Future work– Design the infrastructure for building actors

with mixed push/pull input ports and output ports

– Partitioning of CI models for scheduling and allocating execution threads

– Explore the relation to dynamic dataflow that uses both data-driven and demand-driven execution strategies