1 / 15

Scheduling and Schedulable Objects

Scheduling and Schedulable Objects. The Parameter Classes. Prepared by: Mamdoh Omar Al-ghrauiz 120050265 Supervise: Eng.Tasneem Darweesh. 10.4 The Parameter Classes. 10.4.1 Release parameters 10.4.2 Periodic and aperiodic parameters 10.4.3 Sporadic parameters

harris
Download Presentation

Scheduling and Schedulable Objects

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Scheduling and Schedulable Objects The Parameter Classes Prepared by: Mamdoh Omar Al-ghrauiz 120050265 Supervise: Eng.Tasneem Darweesh

  2. 10.4 The Parameter Classes 10.4.1 Release parameters 10.4.2 Periodic and aperiodic parameters 10.4.3 Sporadic parameters 10.4.4 Scheduling Parameters 10.4.5 The ProcessingGroupParameters class

  3. 10.4.4 Scheduling Parameters • Typically, scheduling parameters are set by the programmer. In order to be fully extensible, the root of the class hierarchy is defined to be empty. package javax.realtime; public abstract class SchedulingParameters implement Cloneable { // constructors public SchedulingParameters(); // methods public void clone(); }

  4. 10.4.4 Scheduling Parameters Cont. • The two subclasses defined by the RTSJ are given below: package javax.realtime; public class PriorityParameters extends SchedulingParameters { // constructors public PriorityParameters(int priority); // Throws IllegalArgumentException if priority // is outside the supported range. // methods public int getPriority(); public void setPriority(int priority) // Throws IllegalArgumentException if priority // is outside the supported range. public String toString(); }

  5. 10.4.4 Scheduling Parameters Cont. package javax.realtime; public class ImportanceParameters extends PriorityParameters { // constructors public ImportanceParameters(int priority, int importance); // Throws IllegalArgumentException if priority or // importance is outside the supported range. // methods public int getImportance(); public void setImportance(int importance); // Throws IllegalArgumentException if importance // is outside the supported range. public String toString(); }

  6. 10.4.4 Scheduling Parameters Cont. • Priorities are used by the priority scheduler. Importance parameters are typically used when a system enters into a transient overload situation where it is unable to meet all its deadlines. In these situations, the scheduler may decide to deschedule one or more schedulable objects. • The importance parameters can be used to inform the scheduler which objects are critical to the system. Their use is not required by the RTSJ default priority scheduler.

  7. 10.4.5 The ProcessingGroupParameters class • In any system where guarantees are required, aperiodic schedulable objects present a problem. • As they have no well-defined release characteristics, they can impose an unbounded demand on the processor's time. • If not handled properly, they can result in periodic or sporadic schedulable objects missing their deadlines, even though those schedulable objects have been "guaranteed".

  8. 10.4.5 The ProcessingGroupParameters class Cont. • One simple way of scheduling aperiodic activities, within a preemptive priority-based scheme, is to run them at a priority below the priorities assigned to periodic and sporadic schedulable objects. In effect, the aperiodic schedulable objects run as background activities and, therefore, cannot preempt the other schedulable objects. • Although a safe scheme, this does not provide adequate support to aperiodic schedulable objects that will often miss their target completion times if they only run as background activities. • To improve the situation, a server can be employed. Servers protect the processing resources needed by periodic and sporadic schedulable objects but otherwise allow aperiodic schedulable objects to run as soon as possible.

  9. 10.4.5 The ProcessingGroupParameters class Cont. • Several types of servers have been defined by the real-time community. The one that is most relevant to the RTSJ is a deferrable server. With the deferrable server, an analysis is undertaken that enables a new logical thread to be introduced at a particular priority level. This thread, the server, has a period and a capacity. • These values can be chosen so that all the periodic and sporadic schedulable objects in the system remain schedulable even if the server executes periodically and consumes its capacity. • At run-time, whenever an aperiodic thread is released, and there is capacity available, it starts executing at the server's priority level until either it finishes or the capacity is exhausted. In the latter case, the aperiodic thread is suspended (or transferred to a background priority). With the deferrable server model, the capacity is replenished every period.

  10. 10.4.5 The ProcessingGroupParameters class Cont. • The RTSJ provides support for aperiodic server technologies via processing group parameters. • When processing group parameters are assigned to one or more aperiodic schedulable objects, a server is effectively created. • The server's start time, cost (capacity) and period is defined by the particular instance of the parameters. These collectively define the points in time when the server's capacity is replenished.

  11. 10.4.5 The ProcessingGroupParameters class Cont. • Any aperiodic schedulable object that belongs to a processing group is executed at its defined priority. However, it only executes if the server still has capacity. • As it executes, each unit of CPU time consumed is subtracted from the server's capacity. When capacity is exhausted, the aperiodic schedulable objects are not allowed to execute until the start of the next replenishment period. • If the application only assigns aperiodic schedulable objects of the same priority level to a single ProcessingGroupParameters object, then the functionality of a deferrable server can be obtained.

  12. 10.4.5 The ProcessingGroupParameters class Cont. • The RTSJ is, however, a little more general. It allows schedulable objects of different priorities to be assigned to the same group, the inclusion of sporadic and periodic schedulable objects, the "servers" to be given a deadline, and cost overrun and deadline miss handlers. • The ProcessingGroupParameters class is given below.

  13. 10.4.5 The ProcessingGroupParameters class Cont. package javax.realtime; public class ProcessingGroupParameters implement Cloneable { // Constructors throw IllegalArgumentException if //cost or period is null. public ProcessingGroupParameters( HighResolutionTime start, RelativeTime period, RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler); // The following constructor is likely to be added in // Version 1.1 of the RTSJ, see Section 10.4.1. public ProcessingGroupParameters( HighResolutionTime start, RelativeTime period, RelativeTime cost, RelativeTime deadline, RelativeTime blockingTerm, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler);

  14. 10.4.5 The ProcessingGroupParameters class Cont. // methods public Object clone(); public RelativeTime getCost(); public AsyncEventHandler getCostOverrunHandler(); public RelativeTime getDeadline(); public AsyncEventHandler getDeadlineMissHandler(); public RelativeTime getPeriod(); public HighResolutionTime getPeriod(); public void setCost(RelativeTime cost); // Throws IllegalArgumentException if cost is null. public void setCostOverrunHandler( AsyncEventHandler handler); public void setDeadline(RelativeTime deadline); public void setDeadlineMissHandler( AsyncEventHandler handler); public void setPeriod(RelativeTime period); // Throws IllegalArgumentException if period is null.

  15. 10.4.5 The ProcessingGroupParameters class Cont. public void setStart(HighResolutionTime start); public boolean setIfFeasible(RelativeTime period, RelativeTime cost, RelativeTime deadline); // Throws IllegalArgumentException if period or cost is null. // The following methods are likely to be added in // Version 1.1 of the RTSJ, see Section 10.4.1. public RelativeTime getBlockingTerm(); public void setBlockingTerm(RelativeTime blockingTerm); public boolean setIfFeasible(RelativeTime period, RelativeTime cost, RelativeTime blockingTerm, RelativeTime deadline); // Throws IllegalArgumentException if period // or cost is null. }

More Related