Back to articles
Address Space and Process Control Block(PCB)

Address Space and Process Control Block(PCB)

via Dev.toShariful Islam Sourav

π€πππ«πžπ¬π¬ π’π©πšπœπž: Every process running on our systems has memory allocated for its address space. Which includes: || 𝘚𝘡𝘒𝘀𝘬 β†’ 𝘎𝘒𝘱 β†’ 𝘏𝘦𝘒𝘱 β†’ π˜‹π˜’π˜΅π˜’ β†’ π˜›π˜¦π˜Ήπ˜΅|| β€’ Stack: Contains function calls, return addresses, local variables etc. β€’ Gap: That's just the empty space kept for the dynamic memory to grow. β€’ Heap: Used for dynamic memory allocation like malloc(), calloc(). β€’ Data: For const, global and static variables. β€’ Text: The program code or program instructions. (Usually read-only) -These address spaces are separate for each process and they cannot access each others. OS manages the whole thing, if something wrong happens OS throws Segmentation Fault. -Address space is virtual. Which is mapped to physical memory by OS. 𝐏𝐂𝐁: In simple words, a Process Control Block is a data structure used by OS to manage processes. It’s like an ID Card for processes. Which includes: β€’ Process ID (PID): Unique id for the process. β€’ Process State: New, Ready, Running, Waiting, Terminated these are the states.

Continue reading on Dev.to

Opens in a new tab

Read Full Article
6 views

Related Articles