HomeSubjectsUniversityBlogAbout

Thread Management

Topic in Operating Systems

210 total MCQsShowing 30 with explanations10 Easy10 Medium10 Hard

About This Topic

A thread is the smallest unit of CPU scheduling: a flow of control that shares its process's code, data and open files but keeps its own stack and registers. Typical items compare user-level and kernel-level threads and the many-to-one, one-to-one and many-to-many mapping models, plus the role of lightweight processes. Amdahl's Law calculations on multicore speedup are common, as is the distinction between concurrency and parallelism. Expect questions on Pthreads and Java threads, thread pools, thread-local storage, what happens when a multithreaded process calls fork(), and asynchronous versus deferred thread cancellation.

Below are 30 practice questions from a pool of 210 Thread Management MCQs, one of 12 topics in Operating Systems. Each shows the correct answer with an explanation; when you are ready, take a timed quiz to test recall under exam conditions.

Practice Questions

Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.

Thread ManagementEasy

Q1. A thread is:

  1. A.A type of volatile memory block
  2. B.A lightweight execution unit in process✓ Correct
  3. C.A physical hardware component part
  4. D.A complete standalone process

Explanation

A thread is a lightweight unit of CPU utilization within a process. It has its own thread ID, program counter, register set, and stack but shares code, data, and resources with other threads in the same process.

Report an error in this question

Thread ManagementEasy

Q2. Threads within the same process share all of the following EXCEPT:

  1. A.Data section
  2. B.Stack space✓ Correct
  3. C.Open files
  4. D.Code section

Explanation

Threads share code, data, and resources (like open files) but each thread has its own stack, program counter, and register set to maintain its individual execution context.

Report an error in this question

Thread ManagementEasy

Q3. What is the main advantage of using threads over processes?

  1. A.Threads can run on different machines
  2. B.Threads are inherently more secure overall
  3. C.Thread creation and switching are faster✓ Correct
  4. D.Threads use significantly more memory

Explanation

Threads are cheaper to create and context-switch than processes because they share the same address space and resources. Only the stack, registers, and program counter need to be saved/restored.

Report an error in this question

Thread ManagementEasy

Q4. User-level threads are managed by:

  1. A.The file system layer
  2. B.A user-level thread library✓ Correct
  3. C.The hardware platform
  4. D.The kernel directly

Explanation

User-level threads are managed by a user-level thread library (like POSIX Pthreads) without kernel involvement. The kernel is unaware of user-level threads.

Report an error in this question

Thread ManagementEasy

Q5. Kernel-level threads are managed by:

  1. A.A web browser
  2. B.A compiler tool
  3. C.User applications
  4. D.The OS kernel✓ Correct

Explanation

Kernel-level threads are managed directly by the operating system kernel. The kernel is responsible for scheduling and managing these threads.

Report an error in this question

Thread ManagementEasy

Q6. Multithreading benefits include all EXCEPT:

  1. A.Resource sharing across threads
  2. B.Responsiveness to user input
  3. C.Economy of creation and switching
  4. D.Guaranteed elimination of bugs✓ Correct

Explanation

Benefits of multithreading include responsiveness, resource sharing, economy (cheaper than processes), and scalability on multiprocessor systems. It does not guarantee elimination of bugs.

Report an error in this question

Thread ManagementEasy

Q7. POSIX Pthreads is:

  1. A.A standard API for thread management✓ Correct
  2. B.A file system for multithreading
  3. C.A hardware component for threads
  4. D.An operating system distribution

Explanation

POSIX Pthreads (POSIX threads) is a standardized API (IEEE 1003.1c) for creating and managing threads, commonly available on UNIX/Linux systems.

Report an error in this question

Thread ManagementEasy

Q8. In a single-threaded process, how many threads of control exist?

  1. A.One thread✓ Correct
  2. B.Many threads
  3. C.Two threads
  4. D.Zero threads

Explanation

A single-threaded process has exactly one thread of control. Traditional (heavyweight) processes are single-threaded, executing one sequence of instructions at a time.

Report an error in this question

Thread ManagementEasy

Q9. Which of the following is a benefit of multithreading in web server applications?

  1. A.It handles multiple client requests concurrently✓ Correct
  2. B.It reduces overall system security
  3. C.It simplifies the server source code logic
  4. D.It eliminates the need for any networking

Explanation

Multithreaded web servers can handle multiple client requests concurrently by assigning each request to a separate thread, improving responsiveness and throughput.

Report an error in this question

Thread ManagementEasy

Q10. A process can contain:

  1. A.One or more threads✓ Correct
  2. B.No threads at all
  3. C.Only two threads
  4. D.Only one thread

Explanation

A process can contain one or more threads. Even a traditional single-threaded process has at least one thread of execution (the main thread).

Report an error in this question

Thread ManagementMedium

Q11. What is the many-to-one threading model?

  1. A.Each user thread maps to one kernel thread
  2. B.Many kernel threads map to one user thread
  3. C.Many user-level threads map to one kernel thread✓ Correct
  4. D.One user thread maps to many kernel threads

Explanation

In the many-to-one model, many user-level threads are mapped to a single kernel thread. The kernel sees only one thread, so if one user thread blocks, all threads in the process block.

Report an error in this question

Thread ManagementMedium

Q12. What is the one-to-one threading model?

  1. A.One process only ever has one thread
  2. B.One kernel thread maps to many user threads
  3. C.One user thread maps to one kernel thread✓ Correct
  4. D.All threads share one single CPU together

Explanation

In the one-to-one model, each user-level thread maps to one kernel thread. This provides more concurrency but thread creation overhead is higher. Linux and Windows use this model.

Report an error in this question

Thread ManagementMedium

Q13. What is the disadvantage of the many-to-one threading model?

  1. A.If one thread blocks, all threads in process block✓ Correct
  2. B.It cannot create more than two threads total
  3. C.It uses too many kernel resources overall
  4. D.It is too slow for practical usage scenarios

Explanation

Since all user threads map to a single kernel thread, if one user thread makes a blocking system call, the kernel thread blocks, causing all other user threads in the process to block as well.

Report an error in this question

Thread ManagementMedium

Q14. What is a thread pool?

  1. A.A memory allocation area used for threads
  2. B.Pre-created threads that wait for work tasks✓ Correct
  3. C.A collection of currently unused threads
  4. D.A debugging tool for analyzing thread bugs

Explanation

A thread pool creates a number of threads at startup that sit idle waiting for work. When a request arrives, a thread from the pool is assigned to service it, avoiding the overhead of creating a new thread each time.

Report an error in this question

Thread ManagementMedium

Q15. What happens to threads when fork() is called in a multithreaded program?

  1. A.The child process is created with no threads
  2. B.All threads are always duplicated in the child
  3. C.Fork cannot be used in multithreaded programs
  4. D.It depends on the system; some dup all, some one✓ Correct

Explanation

The behavior of fork() in multithreaded programs depends on the system. POSIX provides two versions: one duplicates all threads, another duplicates only the calling thread. Typically only the calling thread is duplicated.

Report an error in this question

Thread ManagementMedium

Q16. What is thread cancellation?

  1. A.Terminating a thread before completion✓ Correct
  2. B.Creating a brand new thread from scratch
  3. C.Moving a thread to a different process
  4. D.Suspending a thread temporarily in place

Explanation

Thread cancellation is the task of terminating a thread before it has finished. It can be asynchronous (immediate termination) or deferred (thread periodically checks if it should terminate).

Report an error in this question

Thread ManagementMedium

Q17. What is the difference between asynchronous and deferred thread cancellation?

  1. A.Asynchronous is safer because it checks all resources before acting
  2. B.Asynchronous terminates immediately; deferred checks at safe points✓ Correct
  3. C.Deferred cancellation is always much faster than asynchronous type
  4. D.There is no difference between the two cancellation types

Explanation

Asynchronous cancellation terminates the thread immediately, which can leave shared data in an inconsistent state. Deferred cancellation is safer as the thread periodically checks cancellation points.

Report an error in this question

Thread ManagementMedium

Q18. Thread-Local Storage (TLS) allows:

  1. A.Threads to communicate with each other via messages
  2. B.Each thread to have its own copy of certain data✓ Correct
  3. C.All threads to share the exact same data copies
  4. D.Data to be stored persistently on disk for threads

Explanation

Thread-Local Storage (TLS) allows each thread to have its own copy of data. Unlike local variables (visible only during a single function invocation), TLS data persists across function calls within that thread.

Report an error in this question

Thread ManagementMedium

Q19. What is implicit threading?

  1. A.Threads that remain invisible to the programmer
  2. B.Threads that run implicitly without any OS scheduling
  3. C.Threads that do not use any system resources at all
  4. D.Transferring thread management to compilers and runtimes✓ Correct

Explanation

Implicit threading transfers the responsibility of creating and managing threads from application developers to compilers and runtime libraries, using approaches like thread pools, OpenMP, and Grand Central Dispatch.

Report an error in this question

Thread ManagementMedium

Q20. OpenMP is used for:

  1. A.File compression utilities
  2. B.Parallel shared-memory programming✓ Correct
  3. C.Database management systems
  4. D.Network programming via APIs

Explanation

OpenMP is an API for parallel programming on shared-memory multiprocessor systems. It uses compiler directives (pragmas) to identify parallel regions that can be executed concurrently by multiple threads.

Report an error in this question

Thread ManagementHard

Q21. What is the many-to-many threading model and what advantage does it offer?

  1. A.It creates many processes for running threads
  2. B.It is the simplest threading model to implement
  3. C.It multiplexes user threads onto kernel threads✓ Correct
  4. D.It maps many threads to many individual CPUs

Explanation

The many-to-many model multiplexes many user threads onto a smaller or equal number of kernel threads. It avoids the blocking issue of many-to-one and the overhead of one-to-one, but is complex to implement.

Report an error in this question

Thread ManagementHard

Q22. What is the two-level threading model?

  1. A.A model with exactly two priority levels only
  2. B.A model with exactly two scheduling queues
  3. C.Many-to-many plus binding user thread to kernel✓ Correct
  4. D.A model that uses exactly two processor CPUs

Explanation

The two-level model is a variation of the many-to-many model that also allows a user thread to be bound to a specific kernel thread (one-to-one binding), combining the flexibility of both approaches.

Report an error in this question

Thread ManagementHard

Q23. What is a Lightweight Process (LWP) in the context of user and kernel thread mapping?

  1. A.A process that runs and completes very quickly
  2. B.A type of user-level thread implementation
  3. C.An intermediate structure between user and kernel✓ Correct
  4. D.A process with very low memory usage footprint

Explanation

An LWP is an intermediate data structure that appears as a virtual processor on which user threads can be scheduled. Each LWP is attached to a kernel thread, and user threads are multiplexed onto LWPs.

Report an error in this question

Thread ManagementHard

Q24. How does signal handling work in a multithreaded program?

  1. A.Signals are ignored in multithreaded programs
  2. B.Only the main thread ever receives any signal
  3. C.Signals are always delivered to every thread
  4. D.Signals go to applicable, all, or designated thread✓ Correct

Explanation

Signal delivery in multithreaded programs can be: to the applicable thread (e.g., division by zero), to every thread (e.g., SIGKILL), to certain threads, or to a designated thread that handles all signals.

Report an error in this question

Thread ManagementHard

Q25. What is the scheduler activation mechanism?

  1. A.A method to start or initialize the operating system
  2. B.A timer-based scheduling technique for real-time use
  3. C.A way to activate the CPU scheduling component
  4. D.Kernel upcalls maintaining correct kernel thread count✓ Correct

Explanation

Scheduler activations provide upcalls - a communication mechanism from kernel to user thread library. When a thread blocks, the kernel makes an upcall to inform the thread library, which can then schedule another thread.

Report an error in this question

Thread ManagementHard

Q26. What is Grand Central Dispatch (GCD)?

  1. A.A database system for concurrency
  2. B.Apple technology managing dispatch queues✓ Correct
  3. C.A network routing protocol for devices
  4. D.A Linux kernel module for scheduling

Explanation

GCD is an Apple technology that manages concurrent operations through dispatch queues (serial and concurrent) backed by a system-managed thread pool, abstracting thread management from developers.

Report an error in this question

Thread ManagementHard

Q27. What is the fork-join parallelism pattern?

  1. A.A pattern for optimizing disk I/O performance
  2. B.A pattern for managing file system operations
  3. C.Parent forks child threads, then joins on completion✓ Correct
  4. D.A pattern for managing network communication tasks

Explanation

Fork-join parallelism divides a task into subtasks (fork), executes them in parallel using multiple threads, and then waits for all subtasks to complete and combines results (join).

Report an error in this question

Thread ManagementHard

Q28. What problem does the clone() system call solve in Linux that fork() doesn't?

  1. A.It creates child processes much faster than fork
  2. B.It allows more than 256 concurrent running processes
  3. C.It prevents zombie processes from accumulating in table
  4. D.It controls exactly which resources parent and child share✓ Correct

Explanation

Linux clone() provides flags to specify exactly which resources are shared between parent and child (memory, file descriptors, etc.), enabling creation of threads (share everything) or processes (share nothing).

Report an error in this question

Thread ManagementHard

Q29. In the context of Intel Threading Building Blocks (TBB), what is a task?

  1. A.A fixed-size dedicated thread object
  2. B.A system call for thread management
  3. C.A work unit mapped to threads by runtime✓ Correct
  4. D.A hardware timer for task scheduling

Explanation

In TBB, a task is a lightweight unit of work that the runtime dynamically maps to available threads. This task-based parallelism abstracts thread management, allowing the runtime to optimize thread usage.

Report an error in this question

Thread ManagementHard

Q30. Why have most modern operating systems moved away from the many-to-many threading model to the one-to-one model?

  1. A.Many-to-many has known security vulnerabilities
  2. B.Systems now efficiently support many kernel threads✓ Correct
  3. C.Many-to-many is more expensive to run overall
  4. D.One-to-one uses significantly less memory overall

Explanation

Modern systems can efficiently support thousands of kernel threads, making the complexity of the many-to-many model (LWPs, scheduler activations) hard to justify. The simpler one-to-one model is sufficient and widely adopted.

Report an error in this question

Ready to test yourself on Thread Management?

Take a timed quiz drawn from 210+ questions on this topic. No signup required — your progress saves in your browser.

Start Thread Management Quiz