241 views
0 votes
0 votes
In thread switch of same process, which of the following value will be changed

a)Program Counter & Stack pointer

b)memory management info & PC

c)mm info and SP

d) only PC

1 Answer

1 votes
1 votes

For this we have to keep in mind which things are common to all threads of a given process and which components are individual for threads..

Actually the resources like code , data , memory and files are shareable among the threads..

So during thread switch these things will not get affected..

Only the things which are specific to a particular thread will be affected which are necessary for a thread to execute its own set of instructions..

These components are namely stack , heap , some registers and program counter..Every thread will have them separately..As stack is individual so is the requirement of separate stack pointer..

So during thread switch these attributes will be updated actually..

Hence through this discussion we can conclude that PC and stack pointers are required..

Hence A) should be the correct answer.

No related questions found