Explain how contextswitching is performed for userlevel thre

Explain how context-switching is performed for user-level threads. Which of the following components of a program are shared across threads in a multithreaded process? Open file descriptors The thread identifier Return addresses Process instructions The stack pointer The program counter Priority Register values Data and variables stored in the heap Current working directory User and group identifiers Stack memory

Solution

contex swithch:

-->It is a process of storing and restoring the state of a process or thread so that execution can be resumed
from the same point at a later time.
-->Contex switch is two types.
-->switching from one process to another is called contex switch.
1)multi processing -- Related to multiple process
2)multi tasking --related to single process multiple programs
-->In this CPU time is shared among running process.when running time for a process
expires,a new process has to be loaded for execution.
-->Commmly we use multi tasking,by defining multiple threads in our program.
-->Thread uses the same memory so memory utilization is there.
-->Thread is light weight process because it shares code,data,heap and open files with the parent process.

---------------------------------------------------------------------------------------------------------------------------------------------------

1)Open file discriptors -- usefull when we want \"Thread specific\" offsets.
2)stack pointer -- used to context swithcing between threads
3)priority -- thread schedular will take priority which thread to execute first
4)Stack memory -- each thread have seperate stack memory

 Explain how context-switching is performed for user-level threads. Which of the following components of a program are shared across threads in a multithreaded

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site