I know the thread context switching is more lightweight than process context switching. Because of
- There is less context of threads to store/load than processes.
- Caches work better.
So, I think it would have to switch threads of a process continuously, just like A1->A2->A1->B1->B2->B3->..., where 'A' and 'B' represent two different processes and the followed numbers represent the different thread of a process.
Unfortunately, I've never found any description about context switching to verify my thought. they all just told me the difference between thread and process.
Could you give me an example about how the scheduler switches different processes and their threads?