120 likes | 224 Vues
University Of Palestine. College of Applied Engineering & Urban Planning Software Engineering Department. Concurrent and Real Time programming. Concurrent and Real Time programming. Scheduling and Schedulable Objects. Scheduling and Schedulable Objects. 2 st Term2009/2010.
E N D
University Of Palestine College of Applied Engineering & Urban PlanningSoftware Engineering Department
Concurrent and Real Time programming Concurrent and Real Time programming
Scheduling and Schedulable Objects Scheduling and Schedulable Objects 2st Term2009/2010
Scheduling and Fixed Priority Scheduling The Basic Model The Priority Scheduler The Parameter Classes Parameters Classes and the Priority Scheduler Alternative Schedulers and EDF Scheduling Summary 1 2 3 4 5 6 7 Contents
1. Introduction • The RTSJ provides a framework from within which on-line feasibility analysis of priority-based systems can be performed for single-processor systems. • The specification also allows the real-time JVM to monitor the resources being used and to release asynchronous event handlers if this use of resources goes beyond that specified by the programmer.
1. Introduction • The RTSJ introduces the notion of a schedulable objectrather than considering only threads. • A schedulable object is any object that implements the Schedulable interface (although the priority scheduler only supports real-time threads and asynchronous event handlers). • This allows the following attributes to be associated with each schedulable object • ReleaseParameters : Giving the processing cost for each release of the object and its deadline. • SchedulingParameters: The SchedulingParameters class is empty; however, subclasses allow the priority of the object to be specified along with its importance to the overall functioning of the application.
1. Introduction • This allows the following attributes to be associated with each schedulable object • MemoryParameters : Giving the maximum amount of memory used by the object in its default memory area, the maximum amount of memory used in immortal memory, and a maximum allocation rate of heap memory. • ProcessingGroupParameters : This allows several schedulable objects to be treated as a group and to have an associated period, cost and deadline (see Section 10.4.5).
1. The Schedulable interface • The methods in the Schedulable interface can be divided into three groups. • Methods that will communicate with the scheduler and will result in the scheduler either adding or removing the schedulable object from the list of objects it manages (called its feasibility set), or changing the parameters associated with the schedulable object (but only if the resulting system is feasible). • Methods that get or set the parameter classes associated with the schedulable object. If the parameter object set is different from the one currently associated with the schedulable object, the previous value is lost and the new one will be used in any future feasibility analysis performed by the scheduler.
1. The Schedulable interface • The methods in the Schedulable interface can be divided into three groups. • Methods that get or set the scheduler. For systems that support more than one scheduler, these methods allow the scheduler associated with the schedulable object to be manipulated. • The full definition of the Schedulable interface is given below. package javax.realtime; public interface Schedulable extends Runnable { // Methods which result in feasibility being tested. public boolean addIfFeasible(); public boolean addToFeasibility(); public boolean removeFromFeasibility();
1. The Schedulable interface public boolean setIfFeasible( ReleaseParameters release, MemoryParameters memory); public boolean setIfFeasible( ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters groupParameters); public boolean setIfFeasible( ReleaseParameters release, ProcessingGroupParameters groupParameters); public boolean setIfFeasible( SchedulingParameters sched, ReleaseParameters release, MemoryParameters memory); public boolean setIfFeasible( SchedulingParameters sched, ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters groupParameters); public boolean setMemoryParametersIfFeasible( MemoryParameters memory); public boolean setProcessingGroupParametersIfFeasible( ProcessingGroupParameters groupParameters); public boolean setReleaseParametersIfFeasible( ReleaseParameters release); public boolean setSchedulingParametersIfFeasible( SchedulingParameters sched);
1. The Schedulable interface public MemoryParameters getMemoryParameters(); public void setMemoryParameters(MemoryParameters memory); public ProcessingGroupParameters getProcessingGroupParameters(); public void setProcessingGroupParameters( ProcessingGroupParameters groupParameters); public ReleaseParameters getReleaseParameters(); public void setReleaseParameters( ReleaseParameters release); public SchedulingParameters getSchedulingParameters(); public void setSchedulingParameters( SchedulingParameters sched); // Methods which get or set the scheduler. public Scheduler getScheduler(); public void setScheduler(Scheduler scheduler); public void setScheduler(Scheduler scheduler, SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters processing); }
Thank You ! Supervisor: Eng : Tasneem Darwish. Done by: Ramy Y. Baraka