Process-Threads
Question 1 |
If an operating system does not allow a child process to exist when the parent process has been terminated, this phenomenon is calls as-
Threading | |
Cascading termination | |
Zombie termination | |
Process killing |
Question 1 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.
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 2 |
Which module gives control of the CPU to the process selected by the short - term scheduler ?
Dispatcher | |
Interrupt | |
Schedular | |
Threading |
Question 2 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.
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.
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.
B, A, D, E, C | |
C, E, D, B, A | |
E, D, C, B, A | |
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.
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 |
A process residing in main memory and ready and waiting for execution, is kept on
Job Queue | |
Execution Queue | |
Wait Queue | |
Ready Queue
|
Question 4 Explanation:
A process residing in main memory and ready and waiting for execution, is kept on Ready queue.
There are 4 questions to complete.