Processes overview
Processes vs Threads
Threads are seen as a normal process in the Linux Kernel, just that they share memory regions with other processes
Each thread has its own program counter, process stack and process registers
A program has processes.
A processes has threads.
Creating processes
A process is created by calling the fork()
system call
fork()
duplicates an existing process, the resulting duplicate is its child
Often, after fork()
is called to duplicate the process, exec()
is called which creates a new address space and loads a new program into it.