Chapter 11 Distributed Processing Co-routines Each co-routine has own stack for activation records Keeps track of point to RESUME Symmetric (peer) relationship rather than master/slave of subroutines Each co-routines has own data
Concurrent Programming Hoare’s Communicating Concurrrent Programs Dijkstra’s guarded commands if B -> X | C -> Y | D -> Z fi do B=> X || C -> Y || D -> Z od Nondeterministic alternative
Ada tasking and the rendezvous Message passing model Issue of cooperation and mutual exclusion synchronization Task protects critical section Task waits for rendezvous select when buffer.count accept put (item: in data) do Buffer (I) := item; end; or when buffer.count > 0 => accept get (item: out data) do item := Buffer [I]; end; end select;
Monitors and protected types Overhead of tasking Context switching; memory overhead Monitors and protected types are protected subroutine calls; lower overhead for single thread of control Shared memory model
Linda and tuple-space Unreliability of programmer-controlled synchronization of data Shared data space (tuple space) is not owned by any program out (“hello world”, 3, 3.1) Places tuple in tuple space in (“hello world”, ?declared int, ?declared float) – removes matched tuple Eval (key, processB) new process begins execution QIX operating system