Process vs. Thread Showdown: The Ultimate Quiz Quiz

  1. Process Isolation

    Which of the following best describes the primary reason processes are typically isolated from each other in an operating system?

    1. To improve inter-process communication speed.
    2. To prevent a process from corrupting the memory of other processes.
    3. To allow multiple processes to share the same memory address space.
    4. To reduce the overhead of context switching.
    5. To enforce single-threading across the system.
  2. Resource Consumption

    Considering resource consumption, what is generally true when comparing a process and a thread?

    1. Threads consume significantly more resources than processes.
    2. Processes and threads consume roughly the same amount of resources.
    3. Processes consume significantly more resources than threads.
    4. Threads never consume memory, only CPU time.
    5. Processes consume less memory but more CPU time.
  3. Context Switching Overhead

    What is typically the cost of context switching between threads compared to context switching between processes?

    1. Context switching between threads is always more expensive.
    2. Context switching between threads is generally faster and less resource-intensive.
    3. Context switching between processes is faster because processes are isolated.
    4. The cost is identical because the operating system handles both the same way.
    5. Context switching is instant and has no cost, therefore, negligible.
  4. Shared Memory

    In a multithreaded environment, how do threads within the same process typically share memory?

    1. Threads cannot share memory and communicate only through message passing.
    2. Threads share the same address space, allowing direct access to the same memory locations.
    3. Threads share memory only through explicitly created shared memory segments.
    4. Each thread has its own private memory space, but can indirectly alter other's.
    5. Threads can only share data using a file system.
  5. Inter-Process Communication (IPC)

    Which of the following is a common method for inter-process communication?

    1. Directly accessing shared memory locations (without synchronization).
    2. Using global variables within the same program.
    3. Pipes, message queues, and shared memory segments.
    4. Automatically shared stack space.
    5. Using the operating system's standard output stream (stdout) exclusively.
  6. Fault Isolation

    If one thread within a process crashes due to a segmentation fault, what is the most likely outcome?

    1. Only the crashing thread is terminated, the process continues.
    2. The entire system crashes to prevent data corruption.
    3. The entire process, including all threads, is terminated.
    4. The operating system attempts to recover the crashing thread automatically.
    5. A new thread is automatically spawned to take its place.
  7. Parallel Processing Scenario

    Which of the following application types would most benefit from a multithreaded architecture?

    1. A single-threaded command-line utility with minimal I/O.
    2. A web server handling multiple concurrent client requests.
    3. A real-time embedded system with strict timing constraints.
    4. A system that reads from a single input stream sequentially.
    5. A simple calculator program.
  8. Green Threads

    What are 'green threads'?

    1. Threads that are exclusively used for handling green screen displays.
    2. Threads managed by the operating system kernel.
    3. Threads managed by a user-level library rather than the kernel.
    4. A type of thread that consumes minimal CPU resources.
    5. Threads that are scheduled based on priority.
  9. Multiprocessing vs. Multithreading: Scalability

    In terms of scalability on a multi-core processor, what is the primary advantage of multiprocessing over multithreading?

    1. Multithreading automatically distributes work across all cores.
    2. Multiprocessing inherently avoids the Global Interpreter Lock (GIL) limitations often found in interpreted languages like Python.
    3. Multiprocessing requires less operating system overhead.
    4. Multithreading has better isolation that reduces conflicts.
    5. Multithreading offers a simplified approach to inter-process communication.
  10. Concurrency and Parallelism

    What is the key distinction between concurrency and parallelism?

    1. Concurrency means tasks run simultaneously; parallelism means tasks appear to run simultaneously.
    2. Parallelism is a software concept, concurrency is a hardware concept.
    3. Concurrency is a programming error; parallelism is the desired outcome.
    4. Concurrency means tasks appear to run simultaneously; parallelism means tasks run simultaneously.
    5. They are synonyms, meaning exactly the same thing.