Com S 541 Lecture -*- Outline -*- * Soft real-time programming (4.6) ------------------------------------------ SOFT REAL-TIME PROGRAMMING (4.6) def: A soft real-time program has deadlines that need to be respected most of the time. ------------------------------------------ Hard real time is where can't ever have exceptions ** Basic operations (Time module) (4.6.1) ------------------------------------------ SOFT REAL-TIME OPERATIONS {Delay I} - waits at least I ms {Alarm I U} - new thread that binds U to Unit after at least I ms {Time.time} - number of seconds since current year ------------------------------------------ Q: How owuld you write Alarm using Delay? See PingPong.oz for the Ping Pong program as a functor (fig 4.30) compile it with ozc -x PingPong.oz *** ticking (4.6.2) ------------------------------------------ TICKING Write NewTicker such that {NewTicker} returns a stream that grows by 1 element per second ------------------------------------------ They use OS.localTime see the text for various refinements