CS452 - Real-Time Programming - Fall 2008

Lecture 26 - Recent Hardware and Real-time Programs


Questions & Comments

  1. Demos:

Hardware

First Generation

  1. Big mainframe computers
  2. Finite state machine controllers

Second Generation

  1. Big mainframe computers
  2. Mini-computers
  3. Other tools, such as state charts

Third Generation

  1. Multi-CPU servers
  2. Micro-computers
  3. Micro-controllers

Fourth Generation

  1. Multi-(multi-core CPUs) called servers
  2. Multi-core microprocessors
  3. Stream processors

Ada Tasking

In the 1970s we started looking for successors to C/Unix-like environments.

Ada was one such

Over-all structure

Create

task T is
    ....   // public face of task
end T; 
task body T is
    ....   // any code at all
end T;

Main program is implicitly called as a task.

Send-Receive-Reply

Tasks can include

  1. Entries in their specifications
    task T is
        entry E( <in & out parameters> );
    end T;
  2. Accept statements that implement the entries
    accept E( <formal parameters> ) do
       ...  //code to be executed
    end E;
  3. Calls to entries in other tasks
    T.E( <actual parameters> );
        

Accept blocks until the call to the entry occurs.

The call blocks until the accept is executed.

Relationship to S/R/R

How do You Write a Server

Presumably

loop
    accept Send( request ) do
        // process request
        // fill in return parameters
    end Send;
end loop;

What's wrong here?

Here is one of the work-arounds.

loop
    select
        SendNotifier( data ) do
            // update internal state
        end SendNotifier;
    or
        SendClient( request ) do
            // fulfil request
        end SendClient;
    end select;
end loop

How does this still fall short?

Is it possible to write a server in a programming language with nested scoping?

Time

Pretty easy. Two time primitives

You can build delay from delay until, but not vice versa.


Return to: