System Calls GATE CS PYQ Quiz (original) (raw)
A process executes the code
fork();
fork();
fork();
The total number of child processes created is
A process executes the following code
for (i = 0; i < n; i++) fork();
The total number of child processes created is
The time taken to switch between user and kernel modes of execution be t1 while the time taken to switch between two processes be t2. Which of the following is TRUE?
- nothing can be said about the relation between t1 and t2
Which of the following standard C library functions will always invoke a system call when executed from a single-threaded process in a UNIX/Linux operating system?
A CPU generally handles an interrupt by executing an interrupt service routine
- As soon as an interrupt is raised
- By checking the interrupt register at the end of fetch cycle.
- By checking the interrupt register after finishing the execution of the current instruction.
- By checking the interrupt register at fixed time intervals.
A computer handles several interrupt sources of which the following are relevant for this question.
. Interrupt from CPU temperature sensor (raises interrupt if
CPU temperature is too high)
. Interrupt from Mouse(raises interrupt if the mouse is moved
or a button is pressed)
. Interrupt from Keyboard(raises interrupt when a key is
pressed or released)
. Interrupt from Hard Disk(raises interrupt when a disk
read is completed)
Which one of these will be handled at the HIGHEST priority?
- Interrupt from CPU temperature sensor
Which one of the following is true for a CPU having a single interrupt request line and a single interrupt grant line?
- Neither vectored interrupt nor multiple interrupting devices are possible.
- Vectored interrupts are not possible but multiple interrupting devices are possible.
- Vectored interrupts and multiple interrupting devices are both possible.
- Vectored interrupt is possible but multiple interrupting devices are not possible.
Consider the following code fragment:
if (fork() == 0)
{ a = a + 5; printf(“%d,%d\n”, a, &a); }
else { a = a –5; printf(“%d, %d\n”, a, &a); }
Let u, v be the values printed by the parent process, and x, y be the values printed by the child process. Which one of the following is TRUE?
Consider the following statements with respect to user-level threads and kernel supported threads
i. context switch is faster with kernel-supported threads
ii. for user-level threads, a system call can block the
entire process
iii. Kernel supported threads can be scheduled independently
iv. User level threads are transparent to the kernel
Which of the above statements are true?
- (ii), (iii) and (iv) only
The following C program is executed on a Unix / Linux system:
C `
#include <unistd.h> int main() { int i; for (i = 0; i < 10; i++) if (i % 2 == 0) fork(); return 0; }
`
The total number of child process created is __________ .
**Note -
This was Numerical Type question.
There are 12 questions to complete.
Take a part in the ongoing discussion