Q81.Marks: +2.0UGC NET Paper 2: Computer Science 7th Dec 2023 Shift 2
Given below are two statements:
Statement (I): A thread is a dispatchable unit of work that does not executes sequentially and is not interruptible
Statement (II): It is not possible to alter the behaviour of a thread by altering its context when thread is suspended
In the light of the above statements, choose the most appropriate answer from the options given below:
1.Both Statement I and Statement II are correct
2.Both Statement I and Statement II are incorrect✓ Correct
3.Statement I is correct but Statement II is incorrect
4.Statement I is incorrect but Statement II is correct
Solution
The correct answer is Both Statement I and Statement II are incorrect
EXPLANATION:
Statement (I): "A thread is a dispatchable unit of work that does not execute sequentially and is not interruptible."
This statement is incorrect. A thread is a basic unit of execution within a process, and it does execute sequentially. Threads can be interrupted, and their execution can be preempted by the operating system scheduler, allowing other threads to run.
Statement (II): "It is not possible to alter the behavior of a thread by altering its context when the thread is suspended."
This statement is also incorrect. The context of a thread includes its register values, program counter, and other execution-related information. When a thread is suspended, its context can be saved, modified, and then restored when the thread resumes execution. This allows for changes in the behavior of the thread.
Therefore, Statement I is incorrect, and Statement II is incorrect as well. The correct answer is option 2) "Both Statement I and Statement II are incorrect.".