OS Organization Sample Exam questions

The flashcards below were created by user geschw66 on FreezingBlue Flashcards.

  1. In UNIX, pipes can be created between processes that do not have any direct parent/child or ancestor/descendant relationship. (T/F)
    FALSE
  2. What is the purpose of the PC?
    a. contains the address of the next operand to be accessed

    b. contains the address of the next instruction to be executed

    c. contains the state of the currently executing process

    d. contains the priority of the current process relative to other processes.

    e. None of the above
    b. contains the address of the next instruction to be executed
  3. What is the principle objective of time sharing?
    a. maximize processor use

    b. minimize memory access time

    c. maximize I/O throughput

    d. minimize response time

    e. All of the above
    d. minimize response time
  4. Cache memory is under the direct control of the memory management unit of the OS.
    a. True
    b. False
    b. False
  5. The two basic steps used by the processor in instruction processing are:
    a. Fetch and Instruction cycles

    b. Instruction and Execute cycles

    c. Fetch and Execute cycles

    d. None of the above
    c. Fetch and Execute cycles
  6. In the Five-State Process Model, the following represents a valid state transition:
    A. New -> Running
    B. New -> Blocked
    C. Running -> Blocked
    d. All of the above
    C. Running -> Blocked
    (this multiple choice question has been scrambled)
  7. In a multithreaded environment, a __________ is defined as the unit of resource allocation and a unit of protection.
    A. strand
    B. thread
    C. process
    D. traced
    C. process
    (this multiple choice question has been scrambled)
  8. T / F  A mutex is a lock implemented as a binary semaphore.
    TRUE
  9. Which of the following is not an advantage of a microkernel over a monolithic kernel:
    A. Extensibility
    B. Increased reliability
    C. Separation of kernel-level and user-level services at the interface
    D. Better flexibility
    C. Separation of kernel-level and user-level services at the interface
    (this multiple choice question has been scrambled)
  10. Which of the following makes the least sense as a model for message
    passing:
    A. Blocking Send, Blocking Receive
    B. Non-blocking Send, Non-blocking Receive
    C. Blocking Send, Non-blocking Receive
    D. Non-blocking Send, Blocking Receive
    C. Blocking Send, Non-blocking Receive
    (this multiple choice question has been scrambled)
  11. It is necessary to ___________________ the activities of various threads so they do not interfere with each other or corrupt data structures.
    A. Delay
    B. Interrupt
    C. Synchronize
    D. Contain
    C. Synchronize
    (this multiple choice question has been scrambled)
  12. Hardware features desirable in a batch-processing operating system include memory protection, timer, privileged instructions, and __________ .
    A. kernels
    B. clock cycles
    C. associated data
    D. interrupts
    D. interrupts
    (this multiple choice question has been scrambled)
  13. A common strategy to give each process in the queue some time in turn is referred to as a __________ technique.
    A. time-slicing
    B. serial processing
    C. round robin
    D. multithreading
    C. round robin
    (this multiple choice question has been scrambled)
  14. What is an interrupt?
    An interrupt is a form of signal delivered to the CPU which causes it to temporarily stop what it is doing and execute a handler routine for processing events that have occurred.
  15. What purpose do interrupts serve?
    Interrupts improve processor utilization by allowing the CPU to do other things while a process is waiting for an event to occur.
  16. Can a machine function well without Interrupts?
    A machine can’t function well without interrupts, as it would then have to busy wait (poll) the devices in the system until a necessary event has occurred.
  17. What principle makes cache memory a feasible solution to use in reducing memory access times associated with the execution of instructions? Explain briefly
    The principle of Locality of Reference makes cache memory a feasible solution. During execution, memory references for both instructions and data tend to cluster. Thus, if blocks are stored in the cache containing these clusters, then memory access time is reduced to accessing the cache, which is much faster than going to the main memory.
  18. List the 5 major activities/functions associated with process management.
    • 1) process creation
    • 2) process scheduling and dispatching
    • 3) process switching
    • 4) process synchronization and inter-process. communication.
    • 5) management of process control blocks.
  19. Describe how a kernel can obtain the advantages of both User Level Threads (ULTs) and Kernel Level Threads (KLTs) without incurring many of the disadvantages of both. Give an example of an operating system that does this.
    By using a combined approach, the OS can obtain the advantages of both techniques while not incurring most of the disadvantages of each approach. An example of such an OS is Solaris.
  20. If a process exits and there are still threads of that process running, will they continue to run?
    If a process exits, then all of its threads are terminated as well, so then it is not possible for them to keep running.
  21. List the reasons why a mode switch between threads might be cheaper than a mode switch between processes.
    Less state information is involved in the mode switch for threads, hence the amount of data that must be backed up for threads is less than the amount of data that must be backed up for processes.
  22. What is Mean Time To Failure?
    Mean Time to Failure is the average amount of time it takes for the system to fail from the time that it comes up.
  23. What is Mean Time To Repair?
    The Mean Time to Repair is the amount of time it takes for the system to come back up after it has failed.
  24. How does Mean Time To Failure and Mean Time To Repair relate to the concept of Availability? Explain briefly.
    Availability is the fraction of time the system is available. The formula for availability is:

    chart?chf=bg,s,00000000&cht=tx&chl=A%20%3D%20%5Cfrac%7BMTTF%7D%7BMTTF%20%2B%20MTTR%7D&chs=316x68
  25. Write a segment of code which creates two new processes, which can communicate via a pipe. You may assume that one of the processes is the parent of the other process, and that the parent process will read from the pipe, and the child process will write to the pipe. The parent process should execute the program “/etc/mybin/programa”, and the child process should execute the program “/usr/sbin/programb”. The original process should continue executing the same code you have written after your code segment.
    Image Upload 1
  26. Write a segment of code to spawn off 5 threads where two the threads execute the consumer() function, two of the threads execute the producer() function, and one thread executes the display_update() function.

    This code should then wait on the threads to terminate. The three functions to be executed have the following function prototypes:

    Image Upload 2
    Image Upload 3
  27. In the following diagram, please fill in the process states, and the actions that cause state transitions.

    Image Upload 4
    Image Upload 5
  28. Draw the complete instruction cycle with interrupts.
    Image Upload 6
  29. Is this bounded buffer Producer / Consumer correct?
    Image Upload 7
    Yes.
  30. Write out a Producer / Consumer Solution for a Monitor solution.
    • Image Upload 8
    • Image Upload 9
  31. Hoar Semantics:
    • Hoare semantics:
    • signalee Q continues and P waits/exits logically natural since the condition that enabled Q might no longer be true when Q eventually executes
    • P needs to wait for Q to exit the monitor
  32. Mesa Semantics:
    • Mesa semantics: signaler P continues
    • Q is enabled but gets its turn only after P either leaves or executes a wait.
Author
ID
318429
Card Set
OS Organization Sample Exam questions
Description
Sample Exam Questions
Updated
Show Answers