HW8-18
59 Questions
14 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Child processes inherit UNIX ordinary pipes from their parent process because:

  • The pipe is part of the code and children inherit code from their parents.
  • A pipe is treated as a file descriptor and child processes inherit open file descriptors from their parents. (correct)
  • The STARTUPINFO structure establishes this sharing.
  • All IPC facilities are shared between the parent and child processes.
  • A blocking send() and blocking receive() is known as a(n) _________________.

  • synchronized message
  • rendezvous (correct)
  • blocked message
  • asynchronous message
  • Assume the shared buffer is implemented as a circular array with two logical pointers: in and out. The variable in points to the next free position in the buffer; out points to the first full position in the buffer. Which of the following is true?

  • The buffer is empty when in == out; the buffer is full when ((in + 1) % BUFFER SIZE) == out; (correct)
  • The buffer is full when in == out; the buffer is empty when ((in + 1) % BUFFER SIZE) == out;
  • All the elements of the buffer can be used;
  • The buffer is empty when in == out; the buffer is full when ((out + 1) % BUFFER SIZE) == in;
  • Imagine that a host with IP address 150.55.66.77 wishes to download a file from the web server at IP address 202.28.15.123. Select a valid socket pair for a connection between this pair of hosts.

    <p>150.55.66.77:3500 and 202.28.15.123:80</p> Signup and view all the answers

    Which of the following statements is true?

    <p>Shared memory is typically faster than message passing.</p> Signup and view all the answers

    Under indirect communication, each process that wants to communicate must explicitly name the recipient or sender of the communication.

    <p>False</p> Signup and view all the answers

    The producer-consumer problem using a bounded buffer cannot be solved using shared memory.

    <p>False</p> Signup and view all the answers

    External data representation (XDR) is used when transmitting data between different machines using an RPC (remote procedure call).

    <p>True</p> Signup and view all the answers

    _____ is not considered a challenge when designing applications for multicore systems.

    <p>Ensuring there is a sufficient number of cores</p> Signup and view all the answers

    In a multithreaded server architecture, which of the following is used to service a new user request?

    <p>a new created thread</p> Signup and view all the answers

    Multiple threads within a process _____.

    <p>may execute different sequences of instructions within any part of the shared program.</p> Signup and view all the answers

    Amdahl's Law describes performance gains for applications with both a serial and parallel component.

    <p>True</p> Signup and view all the answers

    Using n threads within a single process is more efficient than using n separate processes because the threads share the same code and data.

    <p>True</p> Signup and view all the answers

    In the many-to-many multi-threading model, which of following is true regarding the number of user-level threads and the number of kernel-level threads?

    <p>The number of user-level threads is always more than or equal to that of kernel-level threads.</p> Signup and view all the answers

    The _____ model maps each user-level thread to one kernel thread.

    <p>one-to-one</p> Signup and view all the answers

    A ____ provides an API for creating and managing threads.

    <p>thread library</p> Signup and view all the answers

    In a many-to-one thread mapping system, suppose process B has two user threads, of which thread 2 is running. If user thread 2 makes a blocking I/O system call, which of the following is true?

    <p>The entire process is in waiting state and blocked.</p> Signup and view all the answers

    Which of the following is a function provided by Pthreads API for constructing a multithreaded program?

    <p>All</p> Signup and view all the answers

    Virtually all contemporary operating systems support kernel threads.

    <p>True</p> Signup and view all the answers

    One-to-one model provides more concurrency than the many-to-one model by allowing another thread to run when a thread makes a blocking system call.

    <p>True</p> Signup and view all the answers

    To associate each thread created using an implicit technique such as a thread pool, with its unique transaction identifier, we could use ____?

    <p>thread-local storage</p> Signup and view all the answers

    Which are included in the context of a thread?

    <p>All</p> Signup and view all the answers

    Which of the following information is shared when the flag CLONE_VM is set up in the Linux clone() system call?

    <p>memory space</p> Signup and view all the answers

    Which of the following is a synchronous signal?

    <p>illegal memory access</p> Signup and view all the answers

    Which of the following is an asynchronous signal?

    <p>terminating a process with specific keystrokes</p> Signup and view all the answers

    Which of the following is a method for implicit threading?

    <p>All</p> Signup and view all the answers

    Deferred cancellation is preferred over asynchronous cancellation.

    <p>True</p> Signup and view all the answers

    Thread-local storage is inherently equivalent to local variables.

    <p>False</p> Signup and view all the answers

    When fork() is invoked, it is passed a set of flags that determine how much sharing is to take place between the parent and child tasks.

    <p>False</p> Signup and view all the answers

    ____ is the number of processes that are completed per time unit.

    <p>Throughput</p> Signup and view all the answers

    Scheduler selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them. CPU scheduling decisions may take place when a process:

    1. Switches from running to waiting state
    2. Switches from running to ready state
    3. Switches from waiting to ready
    4. Terminates Which of those cases would happen for a non-preemptive scheduler?

    <p>1 and 4</p> Signup and view all the answers

    Assume process P0 and P1 are the process before and after a context switch, and PCB0 and PCB1 are respectively their process control block. Which of the following time units are included inside the dispatch latency?

    <p>save state into PCB0, and restore state from PCB1</p> Signup and view all the answers

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

    <p>Response time</p> Signup and view all the answers

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

    <p>Turnaround time</p> Signup and view all the answers

    A typical process has a large number of short CPU bursts and a small number of long CPU bursts.

    <p>True</p> Signup and view all the answers

    A typical process has a large number of short CPU bursts and a small number of long CPU bursts.

    <p>True</p> Signup and view all the answers

    In a CPU-scheduling algorithm, the waiting time represents the time a process spends waiting for I/O devices.

    <p>False</p> Signup and view all the answers

    The first-come, first-served (FCFS) scheduling algorithm is always non-preemptive.

    <p>True</p> Signup and view all the answers

    The Shortest-Job-First (SJF) scheduling algorithm gives the minimum average waiting time for a given set of processes.

    <p>True</p> Signup and view all the answers

    _____ attempts to keep a thread running on the same processor.

    <p>Processor affinity</p> Signup and view all the answers

    The Linux CFS scheduler identifies _____________ as the interval of time during which every runnable task should run at least once.

    <p>targeted latency</p> Signup and view all the answers

    The two general approaches to load balancing in multi-processor CPU scheduling are __________ and ____________.

    <p>push migration, pull migration</p> Signup and view all the answers

    What is the numeric priority of a Windows thread in the BELOW_NORMAL_PRIORITY_CLASS with NORMAL relative priority?

    <p>6</p> Signup and view all the answers

    In the Linux CFS scheduler, the task with smallest value of vruntime is considered to have the highest priority.

    <p>True</p> Signup and view all the answers

    Load balancing algorithms have no impact on the benefits of processor affinity.

    <p>False</p> Signup and view all the answers

    Load balancing is typically only necessary on systems with a common run queue.

    <p>False</p> Signup and view all the answers

    Solaris and Windows assign higher-priority threads/tasks longer time quantums and lower-priority tasks shorter time quantums.

    <p>False</p> Signup and view all the answers

    Which of following is generally true of round-robin scheduling relative to FCFS?

    <p>Round-robin has higher overhead.</p> Signup and view all the answers

    If a shared global variable x is initialized to 1, two threads execute concurrently statements "x++" and "x--" respectively. What are the possible values of x after the execution of the statements?

    <p>All</p> Signup and view all the answers

    Assume count is a variable name, which of the following operations is atomic?

    <p>none</p> Signup and view all the answers

    Which is true about race conditions

    <p>both</p> Signup and view all the answers

    Instructions from different processes can be interleaved when interrupts are allowed.

    <p>True</p> Signup and view all the answers

    Race conditions can result in corrupted values of shared data.

    <p>True</p> Signup and view all the answers

    A(n) _______ refers to where a process is accessing/updating shared data.

    <p>critical section</p> Signup and view all the answers

    _____ is not a technique used for handling critical sections in operating system kernels.

    <p>Peterson's algorithm</p> Signup and view all the answers

    Which of the following critical-section problem's requirements ensures only one process is active in its critical section at a time?

    <p>mutual exclusion</p> Signup and view all the answers

    Which of the following critical-section problem's requirements limits the amount of time a program will wait before it can enter its critical section?

    <p>bounded waiting</p> Signup and view all the answers

    Which of the following indicates that Pi can enter the critical section in Peterson's solution?

    <p>flag[j] == false or turn == i</p> Signup and view all the answers

    Which of the following variables are shared between the processes in Peterson's solution?

    <p>both</p> Signup and view all the answers

    Use Quizgecko on...
    Browser
    Browser