Process-threads

Question 1
Given below are two statements: one is labelled as Assertion A and the other is labelled as Reason R
Assertion A: A process involves a library function to create a thread
Reason R: The threads make system calls to convey their resources and I/O requirement to the Kernel
In the light of the above statements, choose the correct answer from the options given below
A
Both A and R are correct and R is the correct explanation of A
B
Both A and R are correct and R is the NOT correct explanation of A
C
A is true but R is false
D
A is false but R is true
Question 1 Explanation: 
The given Assertion A and Reason R are both correct, but Reason R is not the correct explanation of Assertion A.
Assertion A talks about a process involving a library function to create a thread. This is a valid statement in the context of multithreading, where a library function can be used to create threads within a process.
Reason R, on the other hand, discusses threads making system calls to convey their resource and I/O requirements to the kernel. While this is a part of how threads may interact with the operating system, it is not a direct explanation of why a library function is used to create threads. The use of a library function to create threads is a high-level programming concept, and the interaction with the kernel for resource management is a lower-level detail.
So, both A and R are correct, but R is not the correct explanation of A.
Question 2
If an operating system does not allow a child process to exist when the parent process has been terminated, this phenomenon is calls as-
A
Threading
B
Cascading termination
C
Zombie termination
D
Process killing
Question 2 Explanation: 
Whenever the process finishes executing its final statement and asks the operating system to delete it by using exit() system call.
If a process terminates either normally or abnormally, then all its children have to be terminated. This concept is referred to as cascading termination.
Question 3
Five jobs A, B, C, D and E are waiting in Ready Queue. Their expected runtimes are 9, 6, 3,5 and x respectively. All jobs entered in Ready queue at time zero. They must run in _____order to minimize average response time if 3 < x < 5.
A
B, A, D, E, C
B
C, E, D, B, A
C
E, D, C, B, A
D
C, B, A, E, D
Question 3 Explanation: 
Shortest job first is the way to minimize average response time.
0 < X ≤ 3: X, 3, 5, 6, 9
3 < X ≤ 5: 3, X, 5, 6, 9
5 < X ≤ 6: 3, 5, X, 6, 9
6 < X ≤ 9: 3, 5, 6, X, 9
X > 9: 3, 5, 6, 9, X
C, E, D, B, A
So, option B is correct.
Question 4
Which module gives control of the CPU to the process selected by the short - term scheduler ?
A
Dispatcher
B
Interrupt
C
Schedular
D
Threading
Question 4 Explanation: 
The CPU-scheduling function is the dispatcher, which is the module that gives control of the CPU to the process selected by the short-term scheduler. It receives control in kernel mode as the result of an interrupt or system call. The functions of a dispatcher involve the following:
1. Context switches, in which the dispatcher saves the state (also known as context) of the process or thread that was previously running; the dispatcher then loads the initial or previously saved state of the new process.
2. Switching to user mode.
3. Jumping to the proper location in the user program to restart that program indicated by its new state.
The dispatcher should be as fast as possible, since it is invoked during every process switch. During the context switches, the processor is virtually idle for a fraction of time, thus unnecessary context switches should be avoided. The time it takes for the dispatcher to stop one process and start another is known as the dispatch latency.
There are 4 questions to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access