Threads

Question 1
Threads of a process share
A
global variables but not heap.
B
heap but not global variables.
C
neither global variables nor heap.
D
both heap and global variables.
       Operating-Systems       Threads       Gate 2017 set-01
Question 1 Explanation: 
Thread share all other resources of process except local data like – register, stack.
Question 2
   
A
I and II only
B
III only
C
IV only
D
III and IV only
       Operating-Systems       Threads       GATE 2017(set-02)
Question 2 Explanation: 
First of all, you need to know about process and threads. A process, in the simplest terms, is an executing program. One or more threads run in the context of the process. A thread is the basic unit to which the operating system allocates processor time. A thread can execute any part of the process code, including parts currently being executed by another thread.
Each thread has its own stack, register and PC. So here address space that is shared by all thread for a single process.
Question 3
Which one of the following is FALSE?
A
User level threads are not scheduled by the kernel.
B
When a user level thread is blocked, all other threads of its process are blocked.
C
Context switching between user level threads is faster than context switching between kernel level threads.
D
Kernel level threads cannot share the code segment.
       Operating-Systems       Threads       GATE 2014(Set-01)
Question 3 Explanation: 
Kernel level threads shares the code segment.
Question 4
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 information
       Operating-Systems       Threads       Gate 2011
Question 4 Explanation: 
A) False, because on per thread basis OS maintains register, stack and program counter.
B) False, OS do maintain a separate stack for each thread.
C) True
D) False
Question 5
Consider the following statements about user level threads and kernel level threads. Which one of the following statements is FALSE?
A
Context switch time is longer for kernel level threads than for user level threads.
B
User level threads do not need any hardware support.
C
Related kernel level threads can be scheduled on different processors in a multi-processor system.
D
Blocking one kernel level thread blocks all related threads.
       Operating-Systems       Threads       Gate-2007
Question 5 Explanation: 
A) True, because as kernel level threads are managed by OS and kernal maintains lots of data structure.
B) True, because kernel is not involved in it.
C) True
D) Blocking one kernel level thread blocks all related threads is false, because kernel level threads are independent.
Question 6
 
A
(ii), (iii) and (iv) only
B
(ii) and (iii) only
C
(i) and (iii) only
D
(i) and (ii) only
       Operating-Systems       Threads       Gate-2004
Question 6 Explanation: 
→ User level thread context switch is faster than kernal level threads. Option A is false.
→ If one user level thread perform blocking operation then entire process will be blocked. Option B is true.
→ User level threads are threads are transparent to the kernal. Because user level threads are created by users. Option D is true.
→ Kernal supported threads can be scheduled independently, that is based on OS. Option C is true.
There are 6 questions to complete.