CSC468/2204 Assignment #2 FAQ

In general:

  1. Can we use enscript to print our source code two pages per sheet?


  2. Apart from minimizing passes of the reference string in Q2, will we be marked on the efficiency of our programs?

    Of course. Remember, though, that efficiency doesn't mean saving an extra byte of memory here or there, or making your code as tight and cryptic as possible. Efficiency means things such as choosing an O(n) algorithm over an O(n^2) algorithm. Don't sacrifice program clarity for optimization.

  3. Is the sample output in the requirements document correct?

    Probably not. I just made up the numbers.

For question #1:

  1. Are we required to use threads?

    No, despite what it says on the assignment

  2. Are interarrival times and service times figured as integers?

    No. Use real numbers, and don't round. The examples in the tutorial notes and the textbook use integers for the sake of simplicity.

  3. Does FCFS mean "first to arrive at the given instant" or "first to arrive since the simulation began"?

    The latter.

  4. Do we need to use the same sequence of interarrival times and service times for each algorithm?

    Yes! You won't be able to meaningfully compare the results otherwise. Make a new instance of each of the random number generators at the beginning of each algorithm.

  5. In the RR scheduling, are we allowed to preempt an active process even though the job queue is empty?

    You could as this is conceptually what is happening; in practice a real scheduler probably would not actually take the job off the CPU and put it back in the queue if the queue were empty.

  6. When does RR reevaluate scheduling?

    After one second or when a process finishes, whichever is sooner. Read your textbook for more details.

  7. Where can I find more information on discrete event simulation?

  8. Is there a limit to the job queue size?


  9. Do we need to show job preemptions or RR quantum expiries in our output?

    You can if you want to.

  10. With 2 CPUs currently running jobs, how do we decide which one to preempt?

    Adopt an efficient strategy.

  11. What's arrival time?

    In the past this term may have been used somewhat ambiguously; the tutorial notes have since been updated to use the term interarrival time -- i.e. the time between arrivals of subsequent processes. The actual point in time a process arrives in the system is more accurately called the arrival instant.

For question #2:

  1. Are we required to use threads?

    No. In fact, you probably shouldn't.

  2. What is the namespace size?

    The namespace size is the number of distinct pages a process has. It is an upper bound on the number of distinct pages in the reference string.

  3. Is there a limit on the number of frames we can allocate in PFF?

    Assume you have sufficient memory to allocate 64 frames.

  4. The description of PFF on the assignment handout doesn't make sense!

    There is a typo. The text "If the IFT is greater than or equal to the IFT" should read "If the IFT is greater than or equal to the threshold". This error is not duplicated in the Week 8 tutorial notes.

  5. What does it mean to go through the reference string as few times as possible?

    It means that for some algorithms, you may be able to pass through the reference string once, generating some special data structure, and then use that data structure to quickly and efficiently determine the page fault rate. (Then again, maybe not. This is for you to determine.)

  6. How do I read/write formatted numerical output in Java?

    For input, see the Java FAQ at For formatted output, use java.text.NumberFormat, or use some third-party I/O library. One such library is at; it emulates C-style printf() calls.

  7. Is there any significance to the formatting of the input file?

    No. It's just a sequence of page references separated by white space.

  8. For LFU, what do we do in the case of a tie?

    Pick some tie-breaking rule and document it. Don't just pick a victim at random.

    Tristan Miller
    Last modified: Wed Nov 8 17:19:18 EST 2000