![]() |
![]() |
Having got the Round Robin dispatcher going from last week, it is now a comparatively simple step to extend your code to make a multi-queue Feedback dispatcher - a working example is given in the course home page (use the feedback.txt file in that directory; e.g. >hostd feedback.txt). Project 2 requires a three level feedback policy with q = 1:
The logic is very similar to the previous exercise except that instead of enqueueing an incomplete process back onto the same (RR) queue that the process came from, the process is enqueued onto a lower priority process queue (if there is one to receive it). Obviously, the lowest priority queue operates in exactly the same way as a simple Round Robin queue. To make theFeedback dispatcher work in the same way as described in Stallings Figure 9.5 (Feedback q=1) the logic should be:
or something like that! As you can see, there is really not much difference between this and the Round Robin we completed last week. Try this with the following job list with a quantum of 1 sec:
This should produce the sequence shown in Stallings Figure 9.5 (Feedback q=1):
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).
©