Lecture 6
Lecture 6
Test Variant 2
1. What allows threads to operate more independently within the same process?
A) Separate address spaces
B) Sharing the same set of open files, alarms, and signals
C) Individual connections to external devices
Correct Answer: B
2. Which programming model does threading simplify compared to traditional
single-threaded processes?
A) Serial computing model
B) Interrupt-driven programming model
C) Multi-threaded programming model
Correct Answer: B
3. What is the primary function of threads in a multi-threaded application?
A) To reduce the application's functionality
B) To allow several tasks to be executed simultaneously
C) To increase the complexity of the application
Correct Answer: B
4. How does thread creation compare to process creation in terms of system
resource usage?
A) Thread creation uses more resources.
B) Thread creation is typically faster and uses fewer resources.
C) There is no difference in resource usage.
Correct Answer: B
5. Why is threading advantageous in applications with both computing and I/O
tasks?
A) It allows these tasks to run sequentially.
B) It slows down the application by separating tasks.
C) It allows overlapping of computing and I/O tasks, improving performance.
Correct Answer: C
6. What kind of parallelism do threads in a single process provide?
A) No parallelism
B) Quasi-parallelism, as they appear to run simultaneously
C) Complete isolation from each other
Correct Answer: B
7. What is a significant risk when multiple threads manipulate the same data?
A) There is no risk as threads are completely secure.
B) Threads may interfere with each other, leading to data corruption.
C) Threads can only read data, not write or modify it.
Correct Answer: B
8. Which system resource do threads within the same process explicitly share?
A) CPUs
B) External devices
C) Memory (address space)
Correct Answer: C
9. What thread state is not immediately ready to run but waiting for an event to
occur?
A) Running
B) Blocked
C) Terminated
Correct Answer: B
10. How do threads enhance user experience in interactive applications?
A) By running each task on a separate computer
B) By allowing uninterrupted user interaction even during heavy processing tasks
C) By focusing all system resources on a single task at a time
Correct Answer: B
11. What is the role of the program counter in a thread's execution?
A) It stores the thread's data.
B) It indicates the next instruction to execute within the thread.
C) It manages the thread's I/O operations.
Correct Answer: B
12. What does it mean when a thread is in the 'ready' state?
A) It is currently executing.
B) It is prepared to run when given CPU time.
C) It has finished execution and is about to close.
Correct Answer: B
13. How do threads within the same process communicate with each other?
A) Through a shared network.
B) By using separate memory spaces.
C) By directly accessing shared memory and variables.
Correct Answer: C
14. Why would a word processor benefit from using multiple threads?
A) To simplify its design by using a single-threaded approach.
B) To manage user inputs, auto-saving, and intensive computations separately.
C) To ensure that only one operation is performed at a time.
Correct Answer: B
15. What common resource do threads within the same process not share?
A) Program counters
B) Memory
C) CPU
Correct Answer: A
16. Which IEEE standard is associated with threads?
A) IEEE 802.11
B) IEEE 1003.1c
C) IEEE 1394
Correct Answer: B
17. What is the advantage of threads sharing an address space?
A) It limits the functionality of the application.
B) It facilitates easier data sharing and communication among them.
C) It makes the system more secure.
Correct Answer: B
18. How does the system ensure that threads appear to run in parallel?
A) By allocating each thread to a separate core
B) Through rapid switching among threads
C) By increasing the clock speed of the CPU
Correct Answer: B
19. What kind of applications benefit most from multithreading?
A) Applications that perform a single task repeatedly
B) Applications that require multiple tasks to be performed, possibly overlapping
C) Low-performance applications that do not handle I/O
Correct Answer: B
20. How do threads differ from processes in terms of execution?
A) Threads run independently on separate physical machines.
B) Threads within the same process can execute concurrently on the same
machine.
C) Threads do not allow concurrent execution.
Correct Answer: B