CS452 - Real-Time Programming - Fall 2008

Lecture 12 - Servers, Nameserver


Questions & Comments

  1. Copying the message

Servers

What this amounts to is

Example of a server

Proprietor

Controls a resource

Provides mutual exclusion by having the only code that accesses the resource

Proprietor provides service to clients

Typical proprietor code

InitializeResource( ... );
RegesterAs( ... ); // What if you are the nameserver?
FOREVER {
   len = Receive( tidptr, ... );
   // Handle errors from Receive
   // Do work. Handle errors that arise during work
   error = Reply( *tidptr, ... );
   // Handle errors from Reply
}

Typical client code

...
WhoIs( proprietor );
...
len = Send( proprietor, request, response );
// Handle errors from Send
...

Like a subroutine call to the client

Generic Problem: Local Delay

Proprietor begins processing

Can other requests be processed? Possible strategies

  1. refusal
  2. siblings
  3. nested receive
  4. early reply


Nameserver

Tasks need to get the Task IDs of tasks they don't know.

Done using a task outside the kernel, called the Nameserver

Basic functionality

This creates a global name-space of task names

Semantics of name-space

Implementation

Code is trivial, and doesn't matter very much how it is written. Why?

Only used during

But do the best you can anyway.

The interesting question. How does a task find out the Pid of the NameServer? Possible solutions.


Return to: