CS452 - Real-Time Programming - Spring 2009
Lecture 32 - History : The Transputer, Occam
Emb
First Generation
Assembly language on big computers
- all computers were big
- polling loops and
Second Generation
Transputer, Occam
Third Generation
Ada: A Third Generation Offshoot
Time
Pretty easy. Two time primitives
- delay until <clock time>
- delay <time interval>
You can build delay from delay until, but not vice versa.
Interrupts
An interrupt handler is a parameterless procedure, that can be attached
(either statically, at compile time, or dynamically, at run-time) to the
occurrence of an interrupt.
Problems
- How would you attach interrupts to hardware that varies from execution
to execution?
task body Int is
loop
accept Interrupt do
// manipulate device
SendServer( error, data )
end Interrupt
end loop
end Int
- Where and how do interrupts get turned on?
- How does the device get initialized?
Notice how device-specific the above code is.
`The Ada programming language defines the semantics of interrupt handling
as part of the tasking mechanism, making it possible to construct
implementation-independent interrupt handlers. However, for the Ada mechanism
to be effective, an implementation must provide support not specified by the
Ada standard, such as for initializing hardware interrupting devices,
handling unexpected interrupts and optimizing for real-time performance
constraints. This paper analyses some of the constraints that efficient
interrupt support places on an implementation. It develops a model for the
interaction between interrupt hardware and Ada tasks and describes
optimizations for Ada interrupt handlers. Implementation issues, including
task priorities and task termination for interrupt handlers, are discussed in
detail.' Real-time interrupt handling in Ada Jørgen Born Rasmussen,
Bill Appelbe, Software Practice and Experience.
The Transputer: a Second Generation Offshoot
Use many co-operating, medium capability microCPUs to do a big job.
- An idea whose time has now come.
- Google
Problem is communication
- Big granularity (thick client: MS, Google)
- minimizes communication
- maximizes replicated data
- The Google approach: a problem nobody thought about.
- Small granularity
- minimizes replicated data
- maximizes communication
- Your system, like threading solutions, relies on shared memory for
communication
- The return of the FORTRAN common block
- How would you handle caching?
Communication requires either
- a common bus, star topology
- passing messages along
- emphasizes the switches
- really more like a hybrid, which is classified differently based on
the level of abstraction.
What about real-time?
- lots of timer (countup) hardware
- interaction of countdown and countup to make your clock server
- Instances of timers are not guaranteed to be synchronized
- How could two timers be synchronized?
The transputer was an early, now vanished, example of the latter
- CPU, memory, switch on one chip
- chips connected in an array
- presumably a run-time system decides where tasks will go in order to
- maximize CPU throughput
- minimize communication overhead
Occam 2
Basic idea
- processes (tasks)
- may be named, take arguments and return values
- may be combined
- channels
- Concept is
- input - channel ? value
- output - channel ! value
- need a protocol (for type safety)
- must be named
- time
Combining processes
- sequential
- conditional
- if/then
- selection by case
- looping
- without test/break
- with test/break
- parallel
- initiated when the keyword PAR occurs.
- alternation
- guarded alternatives
- if more than one guard is true then select at random
Channels
- input
channel ? variable
- variable type must match protocol
- real-world hardware acknowledged by the anarchic protocol
- blocks when channel is empty
- output
channel ! value // the value of a variable or the result of an procedure
- variable type must match protocol
- blocks until an input process accepts the data
- input & output provide synchronization
- similar to sockets except for output blocking
- variant protocols are possible
- These require typed input
Time
The Result
You can write a type-safe server, BUT
- all possible clients must be known at compile time.
Program structure is more static than is allowed in your system.
This might be a good thing.
Return to: