Processes and Threads

Process

Process is a running instance of a program. Which means, codes that we wrote are executed and has a space on memory is a process.

  • Program Counter(PC)

  • Registers

  • Execution Flags

  • Stack

TEXT

DATA

(ref: Notice that the sizes of the text and data sections are fixed, as their sizes do not change during program run time.)

STACK

HEAP

References

Abraham Silberschatz, Greg Gagne, and Peter Baer Galvin, “Operating System Concepts, Tenth Edition “, Chapter 3

( TODO: improve references info )

Thread

Process might have multiple threads. Thread is the unique context of process.

In computer science, a thread of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system. wikipedia

Address space

Address space is available memory for the process and this space assigns by the operating system to user.

Address space can be logical(virtual) and physical. If the address space is generated by CPU it’s a virtual adress space. If the address space on the pyscial memory it is physical memory adress space.