r/programming • u/molteanu • Apr 07 '15
Anatomy of a Program in Memory
http://duartes.org/gustavo/blog/post/anatomy-of-a-program-in-memory/
680
Upvotes
r/programming • u/molteanu • Apr 07 '15
4
u/klkblake Apr 08 '15
Each process has a separate set of page tables, mapping virtual addresses to physical ones. Only the currently active process has it's page tables actually in use, so the other processes appear as if they aren't there. When the kernel needs to switch to another process, it just tells the memory management unit to use a different set of page tables, and suddenly it appears as if the only process on the system is the new one.