CSCI 3323 (Principles of Operating Systems), Fall 2021:
Homework 2b

Credit:
20 points.

Reading

Be sure you have read, or at least skimmed, Chapter 7 of the textbook.

Programming Problems

Do the following programming problems. You will end up with at least one code file per problem. Submit your program source (and any other needed files) one of two ways:

You can develop your programs on any system that provides the needed functionality, but I will test them on one of the department's Linux machines, so you should probably make sure they work in that environment before turning them in.

  1. (20 points)

    The starting point for this problem is a Scala script SchedulerStarter.scala that simulates execution of a scheduler, much as the textbook does in Chapter 7, but collecting the information in table form. Comments describe input and desired output. Currently the program simulates only the FCFS algorithm. Your mission is to make it simulate additional algorithms:

    For up to 5 extra points you can make it also simulate SJF with preemption.

    Note that the textbook is, I think, a little unclear about what happens in round-robin when a job ends before the end of its time slice. I want you to assume that a new job is scheduled right away, though we will simplify a little bit and assume that everything happens in multiples of some basic time unit, though how that relates to seconds we won't try to say.

    Sample input and output:

    Note that this is a Scala script rather than a program to compile (this seemed simpler to me); if you've forgotten how to run those, it's just scala and the source-file name and any parameters (here, the name of the input file and the optional keyword -verbose).

    Comments in the code indicate what you need to fill and some tips for doing so. Note that while this may seem like a biggish assignment just based on the description, I think when you look at the starter code you'll realize that it's not so bad. SJF need not be difficult; round-robin is harder but doable if you take the approach I recommend.

Essay and pledge

Include with your assignment the following information.

For programming assignments, please put it a separate file. (I strongly prefer plain text, but if you insist you can put it in a PDF -- just no word-processor documents or Google Drive links please.) For written assignments, please put it in your main document.

Pledge

This should include the Honor Code pledge, or just the word “pledged”, plus at least one of the following about collaboration and help (as many as apply). Text in italics is explanatory or something for you to fill in; you don't need to repeat it!

Essay

This should be a brief essay (a sentence or two is fine, though you can write as much as you like) telling me what if anything you think you learned from the assignment, and what if anything you found interesting, difficult, or otherwise noteworthy.




2021-10-13