Reece McMillin

Chapter 4, 5 Quiz

2022-03-04

  1. Which of the following items are shared across multiple threads belonging to the same process?

    • code
    • stack
    • files
    • data
    • registers
  2. What are the benefits of multi-threaded programming?

    • resource sharing
    • economy
    • responsiveness
    • easy debugging
    • scalability
  3. Which of the following refers to the capability to allow multiple tasks to make progress on a single-processor system?

    • data parallelism
    • task parallelism
    • parallelism
    • concurrency

    amdahl's law

    If $S$ is the is the portion of the application that must be performed serially on a system with $N$ processing cores,

$$speedup \leq \frac{1}{S + \frac{(1-S)}{N}}$$

  1. Amdahl's Law is the formula that identifies potential performance gains froma dding additional computing cores to an application that has both a parallel and serial component.

  2. Ensuring there is a sufficient number of cores is not considered a challenge when designing applications for multicore systems.

  3. Which of the following models are possible for the relationship between user threads and kernel threads?

    • many-to-many model
    • many-to-one model
    • two-level model
    • one-to-many model
    • one-to-one model
  4. The one-to-one model maps each user-level thread to one kernel thread.

  5. The many-to-many model multiplexes many user-level threads to a lesser or equal number of kernel threads.

  6. Which are included in the context of a thread?

    • private storage area
    • register set
    • stacks
  7. The ready queue can be implemented as a tree, unordered linked list, FIFO queue, or priority queue.

  8. Cooperative scheduling can take place under the following circumstances:

    • running $\to$ waiting
    • process termination
  9. Preemptive scheduling can take place under the following circumstances:

    • running $\to$ ready
    • waiting $\to$ ready
  10. Which of the following items do not belong to the function of a dispatcher?

    • selecting a process among the available ones in the ready queue

    roles of the dispatcher

  • switches context from one process to another
    • switching from kernel mode to user mode
    • jumping to the proper location in the user program to resume that program
  • </p>
    
    1. Assume process $P_0$ and $P_1$ are the process before and after a context switch, and $PCB_0$ and $PCB_1$ are respectively their process control blocks. Which of the following time units are included inside the dispatch latency?

    2. Which of the following criteria is more important for an interactive system?

    3. Which of the following criteria is more important from the point of view of a particular process?

    4. I/O-bound programs typically have many short CPU bursts, while CPU-bound programs might have a few long CPU bursts.

    5. The convoy effect occurs in FCFS scheduling when a process with a long CPU burst occupies the CPU.

    6. A significant problem with priority scheduling algorithms is starvation.

    7. The process burst time is: