Real-Time Programming Languages - Operating Systems
Real-Time Programming Languages - Operating Systems
Real-Time Programming Languages - Operating Systems
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Recurrent Tasks (1)<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 />
with Ada.Task_Identification; use Ada.Task_Identification;<br />
with Ada.<strong>Real</strong>_<strong>Time</strong>; use Ada.<strong>Real</strong>_<strong>Time</strong>;<br />
package Periodic_Scheduler is<br />
procedure Set_Characteristic(T : Task_Id; Period : <strong>Time</strong>_Span;<br />
First_Schedule : <strong>Time</strong>);<br />
procedure Wait_Until_Next_Schedule; -- potentially blocking<br />
end Periodic_Scheduler;<br />
with Ada.Task_Attributes;<br />
package body Periodic_Scheduler is<br />
Start_Up_<strong>Time</strong> : <strong>Time</strong> := Clock;<br />
type Task_Information is<br />
record<br />
Period : <strong>Time</strong>_Span := <strong>Time</strong>_Span_Zero;<br />
Next_Schedule_<strong>Time</strong> : <strong>Time</strong> :=<br />
<strong>Time</strong>_Of(100_000,<strong>Time</strong>_Span_Zero);<br />
end record;<br />
Default : Task_Information;<br />
-- a default object needs to be provided<br />
-- to the following package instantiation<br />
package Periodic_Attributes is new<br />
Ada.Task_Attributes(Task_Information, Default);<br />
use Periodic_Attributes;<br />
Burns,<br />
Wellings<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 57