Process vs. Thread Showdown: The Ultimate Quiz! Quiz

  1. Process Isolation

    Which characteristic best describes how operating systems manage processes?

    1. Processes share the same memory space by default.
    2. Processes are isolated, each with its own memory space.
    3. Processes communicate directly through shared variables.
    4. Processes are grouped into threads for resource sharing.
    5. Processes cease once they terminate
  2. Resource Usage

    Which typically has a higher overhead in terms of resource usage: creating a new process or creating a new thread within an existing process?

    1. Creating a thread.
    2. Creating a process.
    3. They have roughly the same overhead.
    4. It depends on the programming language.
    5. It depends on the operating system.
  3. Inter-Process Communication (IPC)

    Which of the following mechanisms is commonly used for inter-process communication (IPC)?

    1. Shared memory within the same process.
    2. Direct access to thread stacks.
    3. Message queues or pipes.
    4. Direct function calls across processes.
    5. Global variables across processes
  4. Concurrency within a Process

    Which feature allows multiple parts of a program to execute concurrently within the same process?

    1. Multiple processes.
    2. Threads.
    3. Virtual machines.
    4. System calls.
    5. Interrupt handlers
  5. Context Switching Speed

    Which is generally faster: a context switch between threads within the same process, or a context switch between two different processes?

    1. Context switching between processes.
    2. Context switching between threads.
    3. The speeds are identical.
    4. Context switching is not possible between processes.
    5. Context switching is not possible between threads.
  6. Crash Impact

    If a thread within a process crashes, what is the likely impact on the rest of the application?

    1. Only the crashing thread will be affected.
    2. The entire process will likely crash.
    3. The operating system will automatically restart the thread.
    4. The operating system will automatically restart the process.
    5. Other processes will be affected.
  7. Threading Models

    Which threading model maps multiple user-level threads to a single kernel-level thread?

    1. One-to-one model.
    2. Many-to-one model.
    3. One-to-many model.
    4. Many-to-many model.
    5. One-to-few model.
  8. Use Case: Web Server

    In a web server, which approach is typically used to handle multiple client requests concurrently: creating a new process for each request, or creating a new thread for each request?

    1. Creating a new process for each request.
    2. Creating a new thread for each request.
    3. Using a single process to handle all requests sequentially.
    4. Using a message queue to handle requests sequentially.
    5. Using a single thread to handle all requests sequentially.
  9. Memory Sharing

    How do threads within the same process typically share memory?

    1. Each thread has its own completely isolated memory space.
    2. Threads share the same code, data, and heap segments.
    3. Threads only share the stack segment.
    4. Threads can choose which parts of memory to share.
    5. Threads share only global variables.
  10. Deadlock Prevention

    Threads are accessing shared resources, what should programmers use to ensure no deadlock happens?

    1. Use atomic operations, mutexes, or semaphores for synchronization.
    2. Avoid using shared resources entirely.
    3. Rely on the operating system to automatically resolve deadlocks.
    4. Increase the number of threads to reduce contention.
    5. Decrease the number of threads to reduce contention.