Recent Changes - Search:

edit SideBar

WhatMoCs

What is a Model of Computation?

A model of computation (MoC) specifies a collect of rules that "govern concurrent execution of the components and the communication between components" for components in a design.

"The rules that constitute a model of computation fall into three categories."

  1. "The first set of rules specifies what constitutes a component." Here, actors are used, where actors are "components that execute concurrently and share data with each other by sending messages through ports".
  2. "The second set of rules specifies the execution and concurrency mechanisms. Are actors invoked in order? Simultaneously? Nondeterministically?"
  3. "The third specifies the communication mechanisms. How do actors exchange data?"

From "System Design, Modeling, and Simulation using Ptolemy II"
http://ptolemy.eecs.berkeley.edu/books/Systems/PtolemyII_DigitalV1_02.pdf

Web service characteristics

Web services generally desire high throughput and low latency. Scalability is an additional concern for the web server. These properties are generally achieved by using asynchronous, non-blocking communication. The notion of a callback is central to web programming.

  • Asynchronous communication
    Asynchronous communication allows clients to process (e.g. displaying part of a web page) while waiting on the result of an HTTP request, which might take one or two seconds or more. Asynchronous Javascript and XML (AJAX) provides a set of Javascript methods for making such requests. Callbacks can be invoked on success, on error, and on completion of an AJAX request.
  • Non-blocking I/O
    New platforms, such as node.js and Vert.x, introduced a non-blocking I/O model to provide scalability on the server side. Instead of allocating a thread per each incoming request, there is a single event loop thread which handles all requests. The event loop thread receives a callback when the response is ready. These platforms support additional worker threads which can be created to handle computationally intense activities that should not be placed in the event thread.

Predictability for Internet of Things applications

Internet of Things applications connect physical devices in the real world. Therefore, predictability is paramount. Throughput and latency must be in an acceptable range, but once they are, even higher throughput and even lower latency do not necessarily create any benefit for the application. Instead, the application may value properties such as causality and meeting real-time deadlines.

Current platforms offer little support for timestamping. Javascript timers provide approximate time interval, offering a lower time bound, but do not provide an upper time bound or guarantee ordering. (For example, in node.js, a 101s callback might occur before a 101s callback since a separate thread is allocated to each time interval. With jitter, the order can be arbitrary.) Vert.x even attempts to redefine "real-time":

"Vert.x provides a complete server side SockJS implementation.
This enables Vert.x to be used for modern, so-called real-time (this is the modern meaning of real-time, not to be confused by the more formal pre-existing definitions of soft and hard real-time systems) web applications.."
http://vertx.io/core_manual_java.html#sockjs

It's perfectly acceptable for a platform to support only untimed MoCs. Many applications do not need timed MoCs. However, is unacceptable to proclaim to support a timed MoC and fall short, or to redefine the problem implying that timing guarantees are never needed.

Accessor MoC demo

What does it look like for an application to run under different MoCs?

Imagine you are developing an application that provides a data stream, where you would like to insert and activate internet-obtained data at certain points. You would like to control the timing of the inserted data, and ensure the length of the stream is unchanged. However, you have no control over the format of the data obtained - it may be of arbitrary length.

In other words, you might be a Norwegian band named Ylvis trying to insert animal sound clips into your latest Youtube sensation music video "The Fox: (What Does the Fox Say?)".

Three models in the Ptolemy repository illustrate the impact of using different models of computation.

  • A pure dataflow model
  • A timed model specifying the sound clip start times
  • A timed model specifying both the clip start times and end times for the inserted data

They can be found in the Ptolemy repository at: $PTII/org/terraswarm/demo/MoC

The sound clips for this model are attached here:
Attach:MoC.zip

Edit - History - Print - Recent Changes - Search
Page last modified on January 15, 2015, at 07:47 PM