COP 4020 Lecture -*- Outline -*- * Soft real-time programming (4.6) (skip) ------------------------------------------ SOFT REAL-TIME PROGRAMMING (4.6) def: A soft real-time program has deadlines that should 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 would 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 Q: Are there similar things available in Java? *** ticking (4.6.2) ------------------------------------------ TICKING Write NewTicker such that {NewTicker} returns a stream that grows by 1 element per second ------------------------------------------ They use Time.time (could also use OS.localTime) see the text for various refinements