During the context switch the operating system (OS) needs information from the CPU to create a Process Control Block (PCB), but accessing the CPU could alter the very information it's trying to capture. please tell me how this is handled.
I have read books on operating system but none of them go into it as i recall. I am unable to find any answer on the web too.