CS452 - Real-Time Programming - Spring 2011

Lecture 17 - Courier/Warehouse

Pubilic Service Announcement

  1. Possible bottlenecks in Terminal/ARM/Train system

Servers and Attendant Tasks

1. Proprietor with a Notifier

2. Using a Courier

Simplest is best

Transmit Notifier Code

Transmit Courier Code

Transmit Proprietor Code

Notes

This gets you through a bottleneck where no more than two events come too fast.

This code, like the previous code, operates correctly if there is more than one notifier.

Remember that all the calls provide error returns. You can/should use them for error recovery

Another possible arrangement for task creation

Another possible arrangement for initialization

Distributed gating

I am showing you collections of tasks implemented together because sets of related tasks is a level of organization above the individual task.


3. Using a Warehouse

Add a warehouse between the courier and the notifier.

Notifier Code

Warehouse Code

Transmit Courier Code

Proprietor Code

Note

This structure clears up most problems when a burst of requests to the server would leave the notifier waiting in a long sendQ..

Two issues:

  1. Handles bottlenecks of all sizes.

    Give a precise and quantitative definition of `bottleneck'.

  2. Server could be buffered on the other side

    Called a guard.

What this amounts to is

Server should be lean and hungry


Debugging Real-time Programs

Stack Trace

In single-threaded programs this is often the most useful tool.

What is the equivalent of a stack trace in a real-time multi-tasking environment?

Breakpoint

What does it do?

How do you get it started?

Breakpoint is a special case of a particular sort of tool that is very common.

Getting information closer to real-time.


Return to: