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.
Question 1 Explanation: 
Thread share all other resources of process except local data like – register, stack.
Question 2

Which of the following is/are shared by all the threads in a process?

I. Program counter

II. Stack

III. Address space

IV. Registers

A
I and II only
B
III only
C
IV only
D
III and IV only
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.
Question 3 Explanation: 
Kernel level threads shares the code segment.
There are 3 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