Real-Time Programming Languages - Operating Systems

Real-Time Programming Languages - Operating Systems Real-Time Programming Languages - Operating Systems

os.inf.tu.dresden.de
from os.inf.tu.dresden.de More from this publisher
28.02.2014 Views

Example: Operator/Subscriber 01 02 03 04 05 06 07 08 09 01 02 03 04 05 06 07 08 09 10 11 12 13 task body Subscriber is Stuarts_Number : Number; begin --.AD ... An_Op.Directory_Enquiry("STUART JONES", "10 MAIN STREET, YORK", Stuarts_Number); -- phone Stuart --.AD ... end Subscriber; task body Telephone_Operator is begin loop -- prepare to accept next call accept Directory_Enquiry(Person : in Name; Addr : in Address; Num : out Number) do -- look up telephone number and -- assign the value to Num null; --.RM end Directory_Enquiry; -- undertake housekeeping such as logging all calls end loop; end Telephone_Operator; Burns, Wellings Ch. 5.1 Page 80 f. WS 2013/14 Real-Time Systems, Real-Time Prog. Languages / Hermann Härtig 24

In detail task executing Server Client 1 Client 2 accept Request Burns, Wellings Ch. 5.1 Page 82 Server.Request task executing a rendezvous end task suspended accept Request Server.Request data exchange end Time WS 2013/14 Real-Time Systems, Real-Time Prog. Languages / Hermann Härtig 25

Example: Operator/Subscriber<br />

01<br />

02<br />

03<br />

04<br />

05<br />

06<br />

07<br />

08<br />

09<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 />

task body Subscriber is<br />

Stuarts_Number : Number;<br />

begin<br />

--.AD ...<br />

An_Op.Directory_Enquiry("STUART JONES",<br />

"10 MAIN STREET, YORK", Stuarts_Number);<br />

-- phone Stuart<br />

--.AD ...<br />

end Subscriber;<br />

task body Telephone_Operator is<br />

begin<br />

loop<br />

-- prepare to accept next call<br />

accept Directory_Enquiry(Person : in Name;<br />

Addr : in Address; Num : out Number) do<br />

-- look up telephone number and<br />

-- assign the value to Num<br />

null; --.RM<br />

end Directory_Enquiry;<br />

-- undertake housekeeping such as logging all calls<br />

end loop;<br />

end Telephone_Operator;<br />

Burns,<br />

Wellings<br />

Ch. 5.1<br />

Page 80 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 24

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!