Test of the Broken Legs

  1. Why should you break your leg?
    1. So the many people you owe money to do not.
    2. Because it helps attract dates.
    3. Codine

  2. Which of these things might make a process lose it's time slice.  Circle all that apply
    1. Reading for the keyboard
    2. Writing to the network
    3. A disk operation previously scheduled by some other process completes

  3. I like chocolate.  I run a large supercomputer.  It's red, with blue trim.  People submit jobs to me, and I run them.  I get $20,000 per job I finish, payable in cash.  I don't care about the answers.  I don't care if my customers like me or think I'm reasonable.  I just want to finish as many jobs as possible, since I want to be rich..  To finish a job I must run the code from begining to completion.  Some are written in C++, and others in Fortran.  None are written in Perl.  I can kill any job I want at any time, but of course I get no money for jobs I kill and don't restart.  I've gots lots of jobs to choose from.  There are no Commedore 64s on my network.  I vacation in the Hamptoms.  What type of scheduler should I use, and why?





  4. I'm still running the supercomputer above.  It's got 4 CPUs, and lots of RAM.  All of the jobs are single-cpu jobs (they can only run on one CPU at a time).  These jobs come in all type, from running simulation of bone breaks to the aerodynamics of childrens sleds.  How many jobs should I schedule at the same time? 





  5. Some peope use priotity scheduling, and others use priority scheduling with aging.  What's the advantage of the second choice?  Don't tell me what aging is, just why someone would want it.



  6. My scheduler works like this:  Any process that arrives gets priority 0.  As long as it's in the ready queue, I add ReadyNum to it's priority every 0.01 seconds.  As long as it's actually running on a CPU, I add CPUnum each 0.01 seconds.  I schedule the job with the higher prioroity number.  What values would make sure that every process gets to run and there was no starvation?
    CPUnum: ________________________________
    ReadyNum: ______________________________

  7. Using a round robin scheduler such that new jobs go to the back of the line, and given the jobs below, what's running at time 7?  If a job is listed as arriving at time 2, that means it's ready for running at time slice #2

  8. Process Name Priority Arrival Time Time Needed
    Emacs 1 1 1000
    ls 10 2 3
    Netscape 5 4 6


  9. Assume that the system is runnning a strict priority scheduler, and the job with the highest priority is currently in an infinite loop.  Choose one
    1. The system is locked up
    2. The system is not locked up

  10. What generates an inturrupt.  List three:
    ____________________________________________________________________________________
    ____________________________________________________________________________________
    ____________________________________________________________________________________

  11. (Yes/No)  Generally speaking, does the inturrupt table change when I context switch?

  12. Jeff notices that his small PC is running very slowly.  It's rather unresponsive when he points and clicks.  The screen redraws slowly.  The disk light is on all the time.  The battery chardges when he plugs it in to the charger.  His computer is this way because of a program I wrote.  I told Jeff that the program I wrote is less than 10 lines.  Help Jeff by telling him what program did wrote?  Put it here: 















  13. (Yes/No) Generally speaking, does the page  table change when I context switch?

  14. (Yes/No/No Way) Is Hop-Along going to go sledding this May?

  15. For a program like 'ls', which takes the most ram?
    1. The code for ls
    2. The data for ls
    3. The stack for ls
    4. The standard C library

  16. Suppose I run the following programs.  How much total RAM do I need to hold everything?  _________________________________

  17. Name of
    Program
    Size of
    Code
    Size of
    Data
    Size of
    Stack
    Number of Copies
    to Run
    Bash 100 200 50 4
    Emacs 1000 200 300 1
    Netscape 2000 10000 300 4


  18. In RandyOS, I have a global list of free pages, which is just a linked list of every page of RAM not otherwise in use.  I have three subsystems in RandyOS:  files systems, networking, and memory management.  I implement the following rules:  The memory managment system can only wait for the global list of free pages.  The network stuff can wait for the global list of free pages or the network card.  The file system can wait for the global list of free pages or to use a disk.  Can RandyOS deadlock because of these systems?

  19. I have two programs.  Which is better from a memory magement perspective?
  20. for(i = 0; i < 99999999; i++) 
        step1(array[i])
    for(i = 0; i < 99999999; i++)
        step2(array[i])
    for(i = 0; i < 99999999; i++) {
       step1(array[i])
       step2(array[i])
    }


  21. When do two processes share the exact same page table?



  22. Here is a page table.  Each page takes 1000 bytes.  How much ram does this process use?  Count carefully!

  23. Page Number Valid Referenced Protection
    5 Y Y R/W
    2 N N R
    3 Y N R
    6 Y Y R/W
    5 Y Y R/W
  24. What's the largest valid address this program can use? __________________________________

  25. Where is address 2345 stored in RAM?  _________________________________

  26. Assume that the 'hand' for the 'one handed clock' has just processed the first entry, and would next process the second.  A page must be brought in.  Which page is kicked out? _____________