1
GATE CSE 2011
MCQ (Single Correct Answer)
+1
-0.3
A thread is usually defined as a ''light weight process'' because an operating system $$(OS)$$ maintains smaller data structures for a thread than for a process. In relation to this, which of the following is TRUE?
A
On per-thread basis, the $$OS$$ maintains only $$CPU$$ register state.
B
The $$OS$$ does not maintain a separate stack for each thread
C
On per-thread basis, the $$OS$$ does not maintain virtual memory state.
D
On per-thread basis, the $$OS$$ maintains only scheduling and accounting
2
GATE CSE 2011
MCQ (Single Correct Answer)
+1
-0.3
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 release)

$$ * \,\,\,$$ Interrupt from Hard Disk (raises interrupt when a disk read is completed)>/p>

Which one these will be handled at the HIGHEST priority?

A
Interrupt from Hard Disk
B
Interrupt from Mouse
C
Interrupt from Keyboard
D
Interrupt from $$CPU$$ temperature sensor.
3
GATE CSE 2011
MCQ (Single Correct Answer)
+2
-0.6
Consider the following recursive C function that takes two arguments:
unsigned int foo (unsigned int n, unsigned int r) {
  if (n > 0) return((n % r) + foo(n/r, r));
  else return 0;
}
What is the return value of the function foo when it is called as foo (513, 2)?
A
9
B
8
C
5
D
2
4
GATE CSE 2011
MCQ (Single Correct Answer)
+2
-0.6
Consider the following recursive C function that takes two arguments:
unsigned int foo (unsigned int n, unsigned int r) {
  if (n > 0) return((n % r) + foo(n/r, r));
  else return 0;
}
What is the return value of the function foo when it is called as foo (345, 10)?
A
345
B
12
C
5
D
3