Page 97 - DCAP608_REAL TIME SYSTEMS
P. 97

Real Time Systems




                    Notes          into non-preemptive procedures). Now the lower bound by constraint 1 has been reduced. Now
                                   we can divide each job in (20,5) into a chain of three slices with execution time 1,3,1. So (20,5) now
                                   in fact is (20,1), (20,3), (20,1). Now we have 5 tasks and we can choose frame size 4.

                                                           Figure 9.4: Example of Job Slices







                                   Source:  ansari.szabist-isb.edu.pk/RTS/RTS0508.ppt
                                   We have not chosen to decompose (20,5) into (20,3) and (20,2) as it would not be possible to fit
                                   these tasks together with T1 and T2 in five frames of size 4. T1 must be scheduled in each frame.
                                   T2 must be scheduled in 4 out of 5 frames. This leaves one frame with 3 units of time for T3. The
                                   other frames only have one unit of time left for T3.

                                   We can schedule two subtasks each with 1 unit of execution time in these frames, but there is not
                                   time in any frame for a subtask with execution time 2.





                                      Task  Draw a diagram for a cyclic schedule with frame size 4.

                                   9.4 Cyclic Executives

                                   The clock driven scheduler must be modified to accommodate the restriction that scheduling
                                   decisions are made only at frame boundaries. The term cyclic executives refer to a scheduler that
                                   deterministically interleaves  and  sequentializes  the  execution  of  periodic tasks on  a  CUP
                                   according to a given cyclic schedule. It also makes scheduling decision only at the beginning of
                                   each frame and deterministically interleaves the execution of periodic tasks.
                                   However it allows aperiodic and sporadic jobs to use the time not used by periodic tasks. The
                                   cyclic executives take over the processor and executes at each of the clock interrupts, which occur
                                   at the beginning of frames. When it executes, the cyclic executive copies the table entry for the
                                   current frame into the current block. It then wakes up  a job, called period task server (Not
                                   needed where periodic tasks never overrun, executive just executes the job slices) , and lets the
                                   server execute the job slices in the  current block.  Upon the completion of the periodic task
                                   server, the cyclic executive wakes ups the aperiodic jobs in the aperiodic job queue in turn and
                                   allows them to use the remaining time in the frame.
                                   The supposition here is that whenever the server or a job completes, the cyclic executives wake
                                   up and executes. The system may  also have an aperiodic task server,  which when  awaked
                                   executes aperiodic jobs in the aperiodic job queue. In addition to scheduling, the cyclic executive
                                   also checks for overruns at the beginning of each frame. If the last job executed in the previous
                                   frame is not complete at that time, the cyclic executive preempts the execution of the job if the
                                   last job is an aperiodic job. The job remains  in the aperiodic job queue and will be resumed
                                   whenever there is time again for aperiodic jobs.
                                   If the cyclic executive finds the periodic task server still executing at the time of a clock interrupt,
                                   a frame overrun occurs. After checking for overruns, the cyclic executive makes sure that all the
                                   job slices scheduled in the current block are ready for execution and then wakes up the periodic
                                   task server to execute them. If there is  still time after all the slices  in the  current block  are





          92                                LOVELY PROFESSIONAL UNIVERSITY
   92   93   94   95   96   97   98   99   100   101   102