Software Systems Spring 2008 For today, you should have: 1) done Homework 2 2) done the reading from notes04 3) prepared for a quiz Outline: 0) quiz 1) workload modeling (notes04) 2) semaphore puzzle: barrier 3) C programming: making change 4) reading questions from last time 5) threads For next time you should: 1) work on the next semaphore puzzle 2) in the Cow Book, read a) the section on Makefiles starting on page 101 b) Testing and Debugging starting on page 104 c) Electronic Archaeology on page 107 d) Chapter 8 (pages 115-124) and do programming exercise 8-1. Suggestion: use several functions rather than nesting for loops! 3) do the reading described below C programming ------------- Notes from homework 2: a solution (change.c) is attached 1) I don't know why the declaration of round isn't in math.h 2) if function A calls function B, I put B first. why? 3) in combinations(), why did I reverse the order of the coins? 4) do the base cases in combo_helper make sense? Any other questions? Reading questions ----------------- A quick aside about our author. Andy Tanenbaum is famous among computer scientists as the author of MINIX, which is the (maybe a) precursor of Linux. In the early days of Linux (1992, if you can believe it), Tanenbaum engaged in a now-famous debate with Linus Torvalds on several points of operating system design. The debate is documented at http://www.oreilly.com/catalog/opensources/book/appa.html Recently the debate flared up again: http://www.cs.vu.nl/~ast/reliable-os/ We might not get a chance to get into this issue in detail, but performance evaluation of a microkernel would be a fine project. Wink, nudge. And now, back to the show! Tanenbaum Chapter 2, Section 5 1) skim Section 2.5 and make an outline so you know where to fit all the information. Keep track of where you are in the outline. 2) give an example of an application that is likely to be CPU-bound and one that is likely to be I/O bound 3) why should an I/O bound process be given higher priority than a CPU-bound process? 4) when does the scheduler run? is the scheduler a concurrent process or a part of the kernel? 5) can you think of real, current environments that are examples of batch, interactive and real-time environments? 6) choose two of the goals from Table 2-38. If a situation came up where the goals were in conflict, which would you consider more important? Under "all systems", I would add * graceful degradation: as the workload approaches and exceeds the capacity of the system, performance degrades gradually and manageably. To understand the goals in Table 2-38, you might find it useful to imagine and outcome that would violate the goal. 7) what is the biggest pro and biggest con of FIFO? 8) what is the biggest pro and biggest con of SJF? 9) why might round robin be a good idea on an interactive system, and not such a good idea on a batch system? 10) what is the primary drawback of multiple queue priority scheduling? 11) name two advantages of lottery scheduling over multi-queue scheduling? 12) fair-share is a fundamentally different idea from the other algorithms in this section. How? 13) give an example of an application that might require periodic real-time scheduling, and another that might require aperiodic RTS. Skim 2.5.5 and 2.5.6