Wednesday, 4 December 2019

POSIX threads

A process is a program (binary) under continuous execution .we will first create our own process.










Now keeping while loop true makes it a process.



















Post compilation if we run our program(binary):
while using ps command in terminal. (PID 3682 is our new process). 

Thread is a lightweight process. A single process can contain multiple threads.
(In Linux kernel everything is a thread each thread has its own visualized processor and address space.)It can be independently scheduled by the kernel.