Thread Switching
Thread switching is a type of context switching from one thread to another thread in the same process. Thread switching is very efficient and much cheaper because it involves switching out only identities and resources such as the program counter(程序计数器), registers(寄存器) and stack pointers(栈指针). The cost of thread-to-thread switching is about the same as the cost of entering and exiting the kernel. 开销差不多相当于系统调用从用户态到内核态或从内核态到用户态。
Process Switching
Process switching is a type of context switching where we switch one process with another process. It involves switching of all the process resources with those n