CS452 - Real-Time Programming - Spring 2009

Lecture 19 - Task Structure

Task Structure

Anthropomorphic Programming

We all, most programmers included, have effective intuitions about human relations

Tasks are independent entities

Servers and Attendant Tasks

Why do servers need attendant tasks?

1. Proprietor with a Notifier

Proprietor `owns' a service, which usually means a resource.

Proprietor Code

Notifier Code


  1. Notifier is usually of higher priority than server
  2. When, and by whom, do interrupts get turned on in the CPU?
  3. Who coordinates hardware ownership?

2. Using a Courier

Simplest is best

  1. Notifier
  2. Courier
  3. Server

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

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

Another possible arrangement for initialization

Distributed gating

3. Buffering

Add buffer before courier and server.

  1. Notifier
  2. Buffer
  3. Courier
  4. Server

This structure clears up problems when the notifier runs too fast for the server.

Two issues:

  1. Handles bottlenecks of all sizes.

    Define `bottleneck'.

  2. Server could be buffered on the other side

    Called a guard.

What this amounts to is

Return to: