![]() |
![]() |
The Resource Management required for the second project is very simple. The Real-Time processes need no i/o resources, so that resource allocation need only be implemented for the Lo-Priority processes. In addition, you know in advance what resources are going to be required by the processes so they can all be allocated before the process is admitted to the feedback queue(s) and marked as READY to run. The check, allocation and freeing of resources can be done at the same time as the check, etc for memory allocation, so it makes sense to have analogous function entry points (e.g. rsrcChk, rsrcAlloc, and rsrcFree).These will be discussed during this weeks tutorials. The only other thing we need to do is merge the two different dispatchers we have written. To comply with the project specification we will also need to add the capability to insert different priority jobs into the three different Feedback queues - you can now see why the list of jobs in rr.txt all have priority 3 so that all the jobs are inserted at the lowest priority feedback queue, effectively limiting our model to a simple Round Robin queue. The Full HOST Dispatcher We should now be ready to put all the parts of the HOST dispatcher together:
Note that there is nothing really new in the above - it is a merging of logic from previous exercises. Try this with the following example job list:
The order of execution will be: T = 0 1 2 3 4 5 6 7 8 9 10 11 P0: PFR S S S R | P1: QR | P2: PF R | P3: PF F R S R | P4: P P P P FR R R | P5: P P P P P P FR R |
Code should be in 'straight' C using the compiler of your choice (cc or gcc). Always use nice to
execute your test programs at lower priority to ensure they do not inconvenience
other users if they go 'haywire'. e.g.: The descriptions of the system functions above are drawn from
sources that include |
![]() | ![]() | ![]() |
For use only by students and instructors using the supplementary material available with the text book: "Operating Systems - Internals and Design Principles", William Stallings, Prentice Hall, 5th Edition, 2004. Not to be printed out or copied by any other persons or used for any other purpose without written permission of the author(s).
©