CS452 - Real-Time Programming - Fall 2008

Lecture 22 - Pathologies

Questions & Comment


1. Deadlock

2. Livelock (Deadly Embrace)

3. Critical Races

Theory of relativity and the event horizon

One task tests a condition

Another task tests the same condition

And the two actions are incompatible.

That is, information about the action of the first task did not spread instantaneously:

Concrete example.

Engineer sends to switchDetective

Before switchDetective does RegisterAs, a second Engineer sends to switchDetective

Each switchDetective, or its courier, does Put and Get to find out about switches.

This is only a little bad, you probably won't even notice it, except your performance will be bad.

But it can be much worse


  1. Small changes in priorities change execution unpredictably, and drastically.
  2. Debugging output changes execution drastically.


  1. A protocol for using the name server
  2. At initialization it's a programming bug,

4. Performance

Local Delay

Client sends a request to a server, which it can't handle immediately. What should the server do?

  1. Wait until it can handle the request, then Reply with the response.
  2. Reply immediately saying that the request cannot be handled.
  3. Queue the client until the request can be handled
  4. Spawn a worker and let the client get the result from the worker.

Remote Delay

Client sends a request to a server, which requires service from another server.


  1. Priority inversion
  2. One resource, many clients


  1. Too many tasks

Layered abstraction are costly

e.g. Notifier -> SerialServer -> InputAccumulater -> Parser -> TrackServer

Return to: