In this project, you will implement several real-time scheduling algorithms and experiment with their use. You will implement a rate-monotonic schedule, earliest deadline first, and either least slack time or shortest completion time schedulers. Run your implementation on QNX on the purplebox targets.
The standard scheduler in QNX is a fixed priority scheduler. At the same priority, the default is non-preemptive scheduling. (Using this scheduler testing a rate-monotonic schedule should be rather straightforward.) You can change this to time-sliced preemptive scheduling within the priority if you need that type of scheduling. Bring up Help -> Help Contents. The sections under getting started with QNX Neutrino have some very helpful information about scheduling and timers.
For the other schedulers, which are dynamic priority schedulers, you will need to do more work. There is no direct access to the QNX scheduling mechanism. You will have to create a task which serves the role of a proxy scheduler. This task has the responsibility to decide which task should run next. This task, which acts as your scheduler, will need to run at a higher priority than any of the tasks being scheduled. You will have to figure out when to run this task, i.e. what is the next scheduling point, and how to get it to execute at that time.
You will need to develop a mechanism to create tasks that have specific compute times and are run at their periodic rate. The compute time must actually use processor cycles and not do a sleep for a period of time. Sleep will not use any processor resources. Once you have a method to spawn tasks with specific characteristics, you will need to build into your scheduler the way to release a specific task for execution when it has the highest priority. For your experiment with the rate-monotonic schedule, the QNX scheduler will do that for you. For the dynamic priority schedulers, your proxy scheduler task will have to do the release.
Note: it is quite common to see the sleep function, or its variants, used in the first real-time programs that developers build. This is a bad habit in the making. Any use of sleep-like functions in your scheduling test fixture must get explicit instructor approval, i.e. be ready to justify why this is the only reasonable way to accomplish what you need to do.
Create several sets of tasks and study the characteristics with each scheduler. Experiment with task sets that pass the schedulability tests and some that do not.
Following are some sample data sets, it is HIGHLY recommended to also create some of your own datasets to be confident in your implementations.
TODO: measure jitter of task burn times, and adjust for that; specify some minimum performance values to analyze so comparisons between teams can be made; how to capture the full set of data using search; provide several task sets to run; provide mechanism for public display of data from standard test sets; description of user events and other time keeping; early submission of data analysis approach.
You will submit a zip file that includes the following items:
Report.doc
or Report.pdf
. Please place it in the top-level directory of files in the zip file.
data
.code
.Before the submission dropbox closes, deposit a zip file in the dropbox. Put your report in the directory at the top-level of this zipfile along with your data
and code
subdirectories. To facilitate the instructor's processing of your submission, please name this file schedule.zip
and record all team member names in the comments section of the submission.
Your work will be evaluated using this grading rubric.