NEW
Font size
WorksheetsThreads & Concurrency Quiz
Total questions: 15
Worksheet time: 8mins
What is a thread primarily composed of?
A CPU and a memory unit
A program counter, a stack, and a set of registers
A process and a scheduler
A kernel and a user interface
Which of the following is a benefit of multithreading?
Increased memory usage
Improved responsiveness
Higher process creation cost
Reduced scalability
What does concurrency allow in a single-core system?
Blocking of all tasks during execution
Increased memory allocation
Only one task to be executed at a time
Simultaneous execution of multiple tasks
What is the main difference between concurrency and parallelism?
Concurrency is only for single-core systems, while parallelism is for multi-core systems
Concurrency is a type of parallelism
Concurrency requires more resources than parallelism
Concurrency allows multiple tasks to progress, while parallelism executes tasks simultaneously
What is data parallelism?
Running multiple threads on a single core
Blocking threads during execution
Distributing subsets of the same data across multiple cores
Distributing unique operations across cores
Which of the following is true about user threads?
They require kernel mode privileges for switching
They are managed by the kernel
They can run on any operating system
They cannot execute system calls
What happens when a user thread executes a system call?
Only that thread is blocked
All threads within the process are blocked
Only kernel threads are blocked
No threads are affected
What is a key advantage of kernel threads?
They are easier to manage than user threads
They can be scheduled on multiple processors
They are faster than user threads
They do not require kernel mode privileges
In the many-to-one threading model, what happens when one thread blocks?
No threads are affected
Only kernel threads are blocked
All threads in the process are blocked
Only that thread is blocked
What is the one-to-one threading model characterized by?
No threads being created
Each user-level thread mapping to a kernel thread
Multiple user-level threads mapped to a single kernel thread
Only one thread per process
What does the many-to-many threading model allow?
Only one user thread per kernel thread
No kernel threads to be created
Only one thread to run at a time
Multiple user threads mapped to multiple kernel threads
What is a threading issue related to signal handling?
How to terminate a thread
Which thread receives a signal in a multithreaded process
How to switch between user and kernel threads
How to create new threads
What is thread-local storage used for?
To block threads during execution
To manage kernel threads
To create data private to a thread
To share data between threads
Which operating systems support kernel threads?
Only Android
Windows, Linux, Mac OS X, iOS, Android
Only Linux
Only Windows
What is a disadvantage of kernel threads?
They are easier to manage than user threads
They do not block other threads
They require a mode switch for thread control transfer
They can be scheduled on multiple processors
