cases of context switch
system calls and library functions differs in terms of invoking.
in Unix based operating system, system calls generate the exception(trap), and invoking system calls will lead to context switch, in case the current process running is not most eligible process to run. where as in case of library function no context switch will be made so executing library function is faster than the system calls.
what are all the reasons for context switch of the process
following are the cases when context switch can occur
1. if process wants go for sleep
2. process do exit
3. while returning from the system call and it is not most eligible process to run
4. when it returns from the interrupt and it is not most eligible process to continue
in Unix based operating system, system calls generate the exception(trap), and invoking system calls will lead to context switch, in case the current process running is not most eligible process to run. where as in case of library function no context switch will be made so executing library function is faster than the system calls.
what are all the reasons for context switch of the process
following are the cases when context switch can occur
1. if process wants go for sleep
2. process do exit
3. while returning from the system call and it is not most eligible process to run
4. when it returns from the interrupt and it is not most eligible process to continue
Comments