Monitoring Pthread Context Switching

Where is The Value of the Current Stack Pointer Register Stored Before Context Switching In POSIX C Threads

This depends entirely upon how the Posix library is implemented. If the threads are implemented by the OS, the values of all registers are stored in the thread's [process] context block before a context switch.

if the thread are implemented in a library, the registers have to be stored in some data structure managed by the library. Such a library implementation needs to save all the general registers but does not (and cannot) need to save the process-specific kernel registers.

When should be process context switching faster over thread's one?

So i got the answer of this question. (From teacher)
Process Switching can be Faster than Thread Switching in 1 case
When there are 2 Processes:
The thread switching between two threads of two different processes is slower than Process switching between two processes



Related Topics



Leave a reply



Submit