Operating Systems, Sixth Edition incorporates a rich set of animations to reinforce the learning experience and to increase the motivation of students. Animations provide a powerful tool for understanding the complex mechanisms of a modern OS. A total of 16 animations are used to illustrate key functions and algorithms in OS design. At the relevant point in the book, an icon indicates that a relevant animation is available online for student use. The animations can be used in two ways. In a passive mode, the student can click on the animation and watch as the given concept or principle is illustrated. Because the animations enable the user to set initial conditions, they can also be used in an active mode. Thus, the animations can serve as the basis for student assignments. The instructor's supplement includes a set of assignments, one for each of the animations.
This brief guide serves to introduce the animations and give you some feel for their operation and use in the classroom.
The animations are located at http://williamstallings.com/OS/Animations.html. You can also reach them by going to the book's Web site at http://williamstallings.com/OS/OS6e.html and then clicking on the Animations link.
Let's look at two examples.
One of the most commonly used problems to illustrate concepts of concurrency is the producer/consumer problem. From the Animations Web site, under Chapter 5, click on the Producer-Consumer link, or click on the link from here.
In this animation, the user can hit the start button and watch the operation of the animation. The system is set to work with a buffer size of 10, 2 producers and 2 consumers. You can hit the start button and watch the operation of the animation. Hit the slower button to make it easier to follow the animation. In the upper right hand corner, the current value of buffer size, number of empty slots, and number of available slots is shown. In the center of the display, you see the buffer fill and empty and you see the status of each producer (producing or waiting) and consumer (consuming or waiting). Having viewed this behavior. You can ask yourself such questions as:
1. Is the buffer often empty, full, or neither? What happens to the producer and consumer processes as a consequence of this result?
2. Is this producer-consumer setup efficient? If not, explain why and explain how to make the setup more efficient?
The student can change the initial conditions. For example, refresh the page to get back to initial conditions, then set the variables to 1 producer, 5 consumers, buffer size of 5. Now hit the start button, and hit slower so that it is easier to follow the action. The same questions as above can be asked and the student can analyze and compare the results.
A more difficult problem for students is to ask the student to come up with initial conditions that produce a given result. For example:
Listed below are characteristics of specific kinds of producer-consumer setups. Using the online animation, determine a producer count, consumer count, and a buffer size, which illustrate each set of characteristics.
a. Producers are blocked during at least 60% of the program run time.
b. Consumers are blocked during at least 60% of the program run time.
For the important topic of OS, a significant design issue is the page replacement algorithm. From the Animations Web site, under Chapter 8, click on the Page Replacement Algorithms link, or click on the link from here.
In this animation, the user chooses one of four page replacement algorithms (Random, FIFO, LRU, MFU). The user can then hit the start button and watch the operation of the animation. The system is set with the following initial conditions: a sequence of page references and the size of memory in frames. As the animation proceeds, the sequence of references is shown and the hits and faults are indicated. At the top, the final results are reported as number of references, number of hits, and number of faults. The report area is a log of all activity. Having viewed this behavior. You can ask yourself such questions as:
1. Which algorithm(s) result in the least amount of page faults at a memory size of 3 frames? 4 frames? 5 frames? 6 frames?
2. Briefly describe the relationship between frame count and the number of page faults.
The student can change the initial conditions. For example, refresh the page to get back to initial conditions, then set the page reference string to 0 1 2 3 0 1 4 0 1 2 3 4. The student can now select one of the page replacement algorithms and a frame size, eventually trying all four algorithms at frame sizes of 3, 4, 5, and 6. Now hit the start button. The same questions as above can be asked and the student can analyze and compare the results.