Real-Time Systems - Study Notes for Assignment 3 | COSC 6384, Assignments of Computer Science

Material Type: Assignment; Professor: Cheng; Class: Real-Time Systems; Subject: (Computer Science); University: University of Houston; Term: Fall 2008;

Typology: Assignments

Pre 2010

Uploaded on 08/17/2009

koofers-user-3gz
koofers-user-3gz 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Assignment 3, COSC 6384
Fall 2008
Task scheduling in real-time systems is to determine an execution order such that all
tasks can meet the corresponding deadlines. To do this, we often need an estimate of the
worst-case execution time (WCET) and then reserve that amount of CPU time
accordingly. An overrun occurs if the real execution time exceeds the estimate WCET.
When it is undetected, subsequent tasks may miss their deadline as a consequence of
overspending CPU time. One solution to the task overrun problem is to lower the priority
of the overrunning task once it consumes the reserved CPU time and only execute it in
the background mode. This requires a measurement of task execution time at run
time.
In real-time systems, a task may be preempted (by high priority tasks) or blocked (due to
unavailable resources locked by low priority tasks). The measurement of execution time
at user application level is difficult, since we cannot predict the instances of preemption
and blocking. On the other hand, it can be done easily at kernel level. As shown in the
following diagram, a task is created, dispatched to run, switched off to waiting or ready
state, and deleted (terminated). The measurement of execution time can be done once we
mark the instances it is dispatched and accumulate the time it has spent when it is
switched off or terminated.
vxWorks allows user tasks to add callback functions (hooks) to kernel at the instances of
task creation, task deletion, and context switching. When a hook is called, the pointer to
the task’s TCB is passed as a parameter. Thus, we can access TCB and use the spare
space in TCB to record additional task information.
What you will do in the assignment:
pf3
pf4

Partial preview of the text

Download Real-Time Systems - Study Notes for Assignment 3 | COSC 6384 and more Assignments Computer Science in PDF only on Docsity!

Assignment 3 , COSC 6384

Fall 200 8

Task scheduling in real-time systems is to determine an execution order such that all tasks can meet the corresponding deadlines. To do this, we often need an estimate of the worst-case execution time (WCET) and then reserve that amount of CPU time accordingly. An When it is undetected, subsequent tasks may miss their deadline as a consequence of overrun occurs if the real execution time exceeds the estimate WCET. overspending CPU time. One solution to the task overrun problem is to lower the priority of the overrunning task once it consumes the reserved CPU time and only execute it in the background mode. This requires a measurement of task execution time at run time. In real-time systems, a task may be preempted (by high priority tasks) or blocked (due to unavailable resources locked by low priority tasks). The measurement of execution time at user application level is difficult, since we cannot predict the instances of preemption and blocking. On the other hand, it can be done easily at kernel level. As shown in the following diagram, a task is created, dispatched to run, switched off to waiting or ready state, and deleted (terminated). The measurement of execution time can be done once we mark the instances it is dispatched and accumulate the time it has spent when it is switched off or terminated.

vxWorks allows user tasks to add callback functions (hooks) to kernel at the instances of task creation, task deletion, and context switching. When a hook is called, the pointer to the task’s TCB is passed as a parameter. Thus, we can access TCB and use the spare space in TCB to record additional task information.

What you will do in the assignment:

The partition problem is an NP-Hard problem. The problem is to decide whether a given set of integers can be partitioned into two "halves" that have the same sum. More precisely, given a set S of integers, is there a way to partition S into two subsets S 1 and S 2 such that the sum of the numbers in S S 1 equals the sum of the numbers in S 2? The subsets 1 and^ S 2 must form a partitioning^ the sense that they are disjoint and they cover^ S. You need to develop a task to solve the partition problem optimally (using exhaustive search). The input is a set of six integers. It must run in vxWorks environment at the target Intel ARM-Xscale processor: Be aware of the issues of data consistency. You need to run the task several time (by generating different data-set) during your experiment. After the finish of every time, please show the data set and result(s) on the console.

  1. Add vxWorks hooks for task execution time measurement.
  2. Feel free to add any tasks to make the above operations more convenient. Assign the tasks with reasonable priorities.
  3. Report the accumulated execution times of terminated tasks (the execution times should be printed out on console, and a host task should be developed to inquire the task execution time measured at the target. 6. (Required!)Develop a test case that contains multiple concurrent tasks (e.g. these tasks can be some one printing a message on the console) to test your measurement and reporting facility. Note that you can design your own format of reporting and how it is done. Please make reasonable assumptions and don’t use any excessive buffers.

For this requirement, I just want you to create several additional

simple tasks except of the task to solve the partition problem.

Make them running together, and that is it~! Don’t worry about the

“buffers” too much because I don’t think you will meet the

problem in this assignment.

Relevant vxWorks facilities for this project The vxWorks' libraries are more than the followings for the given purpose and of course you're not restricted to use just those. They are listed to give you a basic idea for the project.

FIRST NAME_LAST NAME_COSC6384 Assignment2.zip