Professional Documents
Culture Documents
Real-Time Operating Systems - POSIX and HRTS Tutorial Problems PDF
Real-Time Operating Systems - POSIX and HRTS Tutorial Problems PDF
UTS:ENGINEERING
48450: REAL-TIME OPERATING SYSTEMS
Tutorial Problems POSIX and HRTS
This is a collection of tutorial problems that is directed at the POSIX programming and Hard Real-time Systems topics. The POSIX programming topics are demonstrated in practice by a collection of small programs that you can download from UTSOnline it's recommended that you compile these programs and observe their behaviour before making some modifications of your choosing to them and assessing the results. Please note that it will be slight variations of a subset of these questions that comprise the final examination.
UTS: ENGINEERING
UTS: ENGINEERING
28. POSIX shared memory offers advantages over other communication methods list these and then describe one problematic issue with the use of shared memory. 29. When used on a shared memory region, what does the ftruncate() system call allow you to do? 30. What is mmap() used to achieve? 31. The unlink collection of system calls, unlink(), mq_unlink(), sem_unlink() and shm_unlink() all perform a similar important function what is it? 32. The SCHED_RR and SCHED_FIFO macros ask the scheduler to behave differently, describe the differences between them. 33. Explain in simple terms the relationship between POSIX clocks and POSIX timers. 34. In the context of a priority based scheduability test, the response time for any task is made up of three factors: the execution time for the task, the interference (or preemption) factor and the blocking factor. Explain their meanings on a timing diagram using a simple three task example.
Task 1
Task 2
Task 3
35. What features of an operating system are necessary to support either rate or deadline monotonic scheduling of a task set? 36. A system call is one type of computational overhead that must be accounted for when applying either Rate Monotonic, or Deadline Monotonic analysis. Explain how this overhead can be incorporated into the analyses and compare this with the way interrupts (and interrupt service routines) can also be incorporated. 37. How does Deadline Monotonic analysis differ from Rate Monotonic analysis? 38. What is priority inversion? 39. How can we incorporate the extra overhead of a system call into RMA?
UTS: ENGINEERING
Some formulae to which you may refer, are listed below Lui and Laylands Theorem 1
n i= 1
Ci
i
n( 2
1 n
Ci Di
Ii Di
where
i 1
Ii =
j= 1
Di Cj Tj
Ci Di
Ii Di
where
i 1
Ii =
j= 1
[ ] [
Task Type Periodic Aperiodic Aperiodic Periodic Periodic
Di D j Di + 1 Cj + Tj Tj
( )] (
Period (seconds) 1.2 1.5 2.5
D i D j Di + 1 min C j , D i Tj Tj Tj
)]
40. A particular real-time system is to support five independent processes sharing one processor, using the Rate Monotonic scheduling algorithm. The time domain parameters for all five processes are tabulated below:
Task Identifier A B C D E Execution Time(seconds) 0.2 0.3 0.4 0.2 0.3 Response Time (seconds) 2.0 3.0 -
What assumption must be made before Liu and Laylands first theorem can be applied? What justification is there for making this assumption? Is the task set schedulable by Liu and Laylands Theorem 1?
UTS: ENGINEERING
41. Consider the following set of tasks with attributes shown - all time quantities are
Note: Unless otherwise stated, assume that deadlines are at the end of the period. Also assume that all application level processing is assigned priorities rate monotonically. Use the expanded (extended) scheduability model to determine if each task is scheduable. Use a clear algebraic notation to represent what you are interpreting as preemption factors, the task itself, and blocking factors before 'plugging in' the numbers. 42. Consider the following process system which is based on deadline monotonic scheduling. Note that all time quantities are measured in milliseconds (msec). Task 1: Task 2: Task 3: C1=5, D1=10, T1=25 C2=10, D2=20, T2=30 C3=15, D3=35, T3=50
See if you can determine the scheduability of all the processes using the imprecise test.
UTS: ENGINEERING
43. Consider the following task set, noting that deadlines are again, no longer coincident with periods: Task Identifier Task A Task B Task C C 3 2 4 D 4 8 14 T 5 15 20
A real-time systems designer has already applied the imprecise deadline monotonic scheduling test and discovered that Task C fails that test. Apply the more precise test to Task C alone and see if that helps determine schedulability.