UNDER CONSTRUCTION!

Introduction

This document describes how to use the SR programming language for concurrent programming in the context of the concurrent process material of an operating systems course. Topics include processes, context switching, atomic instruction/action, shared data, race conditions, critical sections, mutual exclusion, semaphores, process synchronization, monitors, interprocess communication, message passing, and the rendezvous. For more detailed coverage of these topics, see the book Operating Systems Programming: The SR Programming Language by Stephen J. Hartley, published by Oxford University Press, 1995, 236 pages, ISBN 0-19-5095790.

The sequential and concurrent features of SR will be described including sequential aspects, multiple processes, multiple resources, process synchronization, semaphores, monitors, message passing, and the rendezvous. SR works on shared memory multiprocessors, uniprocessors, and workstations on a LAN.

The XTANGO animation interpreter program, animator, is used to animate several SR programs simulating classical operating systems synchronization problems, such as the dining philosophers. You can set up your Web browser to spawn the interpreter as an ``external viewer'' to see these animations. To spawn XTANGO's animator as an external viewer, do the following things.

  1. put a file .mailcap in your home directory containing
    #use this to display .anm files
    application/x-anm; animator; stream-buffer-size=2000
    
    where animator has to be in your path (or specify the full path to it, which is ~shartley/MCS361/animator or /usr/local/bin/animator)
  2. put a file .mime.types in your home directory containing
    # Use XTANGO's animator program to map .anm extension to x-anm
    application/x-anm        anm
    
  3. execute the command
    xrdb -merge ~shartley/MCS361/xtango.res
    
  4. Drexel students: To spawn the animator external viewer, you must be running your browser on one of the MCS machines such as queen. If you are on a Mac somewhere, run an X windows browser on an MCS machine and set DISPLAY to be your Mac (which must be running MacX).
  5. If the XTANGO window is too big for your screen, such as a Macintosh monitor, then do the following for a smaller XTANGO window.
    xrdb -merge ~shartley/MCS361/xtango.res.Mac
    

Concurrent Programming is the intersection of two areas: Operating Systems

and Parallel Processing.

Concurrent programming is a combination of the last item of the OS list and the last three items of the PP list. Closely related is the concept of a thread or lightweight process. One kind of concurrent programming is writing a program that becomes a process with multiple threads of control when the program is executed.

We will look at operating systems support (tools) for shared memory multiprocessors

and distributed memory multicomputers: message passing/rendezvous

Parallel processing: programming styles using these tools and/or architectural features (master/worker, data parallelism, systolic).

Classical OS synchronization problems:


SJH
shartley@mcs.drexel.edu