309 views

1 Answer

0 votes
0 votes
When a context switch in processes occurs, the kernel saves the context
of the old process in its PCB and loads the saved context of the new process
scheduled to run. Context-switch time is pure overhead, because the system
does no useful work while switching.

Allocating memory and resources for process creation is costly.
Because threads share the resources of the process to which they belong,
it is more economical to create and context-switch threads.

Related questions

1 votes
1 votes
2 answers
1
rahul sharma 5 asked Dec 6, 2017
691 views
Why threads have less context than process? Context means various attributes that we store in the PCB,so the attributes like state,property,PC,etc.. should be there in b...
0 votes
0 votes
3 answers
2
jayadev asked Feb 1, 2022
988 views
Consider the following program segment of C-programming language:#include<stdio.h int main() { if (fork() || fork()) fork(); printf("GATE\n"); return 0; } Number of times...
0 votes
0 votes
1 answer
3
jayadev asked Dec 7, 2021
440 views
Why the operating system has the knowledge about kernel level threads but not about user level threads?
1 votes
1 votes
1 answer
4
jayadev asked Dec 6, 2021
384 views
Does kernel level threads have separate PCB(process control block)?