Real-Time Programming Languages - Operating Systems
Real-Time Programming Languages - Operating Systems Real-Time Programming Languages - Operating Systems
Example: Operator/Subscriber 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 task body Telephone_Operator is Workers : constant Integer := 10; Failed : Number; begin loop -- prepare to accept next request select accept Directory_Enquiry(Person : in Name; Addr : in Adress; Num : out Number) do -- look up telephone number and assign the value to Num end Directory_Enquiry; or accept Directory_Enquiry(Person : in Name; Zip : in Postal_Code; Num : out Number) do -- look up telephone number and assign the value to Num end Directory_Enquiry; or accept Report_Fault(Num : Number) do Failed := Num; end Report_Fault; -- log faulty line and allocate repair worker end select; – undertake housekeeping such as logging all calls end loop; end Telephone_Operator; Burns, Wellings Ch. 6.1 Page 99 f. WS 2013/14 Real-Time Systems, Real-Time Prog. Languages / Hermann Härtig 54
Example: Operator/Subscriber 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 task type Subscriber; task body Subscriber is Stuarts_Number : Number; begin loop --... select An_Op.Directory_Enquiry("STUART JONES", "10 MAIN STREET, YORK", Stuarts_Number); -- log the cost of a directory enquiry call or delay 10.0; -- phone up his parents and ask them, -- log the cost of a long distance call end select; --... end loop; end Subscriber; Burns, Wellings Ch. 6.9 Page 119 WS 2013/14 Real-Time Systems, Real-Time Prog. Languages / Hermann Härtig 55
- Page 3 and 4: RT Language Classes Synchronous HLL
- Page 5 and 6: Synchronous Systems → Synchronous
- Page 7 and 8: Esterel at a glance Most statements
- Page 9 and 10: Esterel „Data“: Variables and S
- Page 11 and 12: Signals vs Variables 01 Emit Count(
- Page 13 and 14: Examples (all by Berry): ABRO Speci
- Page 15 and 16: Speed Specification SPEED: Count th
- Page 17 and 18: Few general points Ada has “Annex
- Page 19 and 20: Concurrency Tasks ● ● ● ● a
- Page 21 and 22: Termination of Tasks Every task has
- Page 23 and 24: The Rendezvous Based on client/serv
- Page 25 and 26: In detail task executing Server Cli
- Page 27 and 28: Select Statement ● ● Arbitrary
- Page 29 and 30: Example: Resource with Locking 01 0
- Page 31 and 32: Tasks ./. Protected Objects 01 02 0
- Page 33 and 34: Fixed Priorities ● task (type) T
- Page 35 and 36: Active Priority Base priority or
- Page 37 and 38: EDF Dispatching How to set deadline
- Page 39 and 40: Mixed Scheduling Policies, example
- Page 41 and 42: Explicit Request Ordering: Requeue
- Page 43 and 44: Timing events 01 02 03 04 05 06 07
- Page 45 and 46: Example: Watchdog 01 02 03 04 05 06
- Page 47 and 48: Time: Delay Statement 01 02 03 04 0
- Page 49 and 50: Delay and Select, client side(1) 01
- Page 51 and 52: Example 01 02 03 04 05 06 07 select
- Page 53: Example: Operator/Subscriber 01 02
- Page 57 and 58: Recurrent Tasks (1) 01 02 03 04 05
- Page 59 and 60: Recurrent Tasks (3) Periodic tasks
- Page 61 and 62: Example 01 02 03 04 05 06 07 08 09
- Page 63 and 64: Example 01 02 03 04 05 06 07 08 09
- Page 65 and 66: Missing in this RT-HLL lecture ●
Example: Operator/Subscriber<br />
01<br />
02<br />
03<br />
04<br />
05<br />
06<br />
07<br />
08<br />
09<br />
10<br />
11<br />
12<br />
13<br />
14<br />
15<br />
16<br />
17<br />
18<br />
19<br />
20<br />
21<br />
22<br />
23<br />
task body Telephone_Operator is<br />
Workers : constant Integer := 10;<br />
Failed : Number;<br />
begin<br />
loop<br />
-- prepare to accept next request<br />
select<br />
accept Directory_Enquiry(Person : in Name;<br />
Addr : in Adress; Num : out Number) do<br />
-- look up telephone number and assign the value to Num<br />
end Directory_Enquiry;<br />
or<br />
accept Directory_Enquiry(Person : in Name;<br />
Zip : in Postal_Code; Num : out Number) do<br />
-- look up telephone number and assign the value to Num<br />
end Directory_Enquiry;<br />
or<br />
accept Report_Fault(Num : Number) do<br />
Failed := Num;<br />
end Report_Fault;<br />
-- log faulty line and allocate repair worker<br />
end select; – undertake housekeeping such as logging all calls<br />
end loop;<br />
end Telephone_Operator;<br />
Burns,<br />
Wellings<br />
Ch. 6.1<br />
Page 99 f.<br />
WS 2013/14 <strong>Real</strong>-<strong>Time</strong> <strong>Systems</strong>, <strong>Real</strong>-<strong>Time</strong> Prog. <strong>Languages</strong> / Hermann Härtig 54