
Threads will share also the same code, data (shared memory) and files. That means, they will share all of the virtual and all physical address mappings. They are part of the same virtual address space. The threads however represent independent execution contexts. As we disused above, the process is represented by address space and contains all mentioned also before blocks. Please, consider following image, which depicts the difference between the process and thread. So one variable with virtual address equals to 0x56543 has to be mapped by Page Table for example to 0x9864728 in DRAM. The OS has to map virtual addresses to physical memory. Due to the complexity of management of the virtual memory (we start different applications, we use different compilers, etc) there is not direct link with the physical addresses memory (DRAM). Each process is uniquely identified by address in address space (V0 - Vmax). Each of these application can be in different state, like executing or waiting but still as a processes.Įach process can be represented as code, data (static data loaded when the process starts to run), heap (dynamically allocated memory) and stack (memory which grows and shirks while the program is executing - it is organised in LIFO order- List In Fist Out). You can start several processes (the same or different)on the same CPU. When you give a command to run the application the code in “transferred” to RAM memory and can be associated as an active entity (PROCESS).

Application you developed and compiled are stored in in the disk ( static entity). Operating system (OS) is responsible for managing a hardware on behalf of application you run. Before we start I will give some simplified introduction to threads in computer science.
