Member-only story
Implementation of Processes and Threads by the Linux Kernel

Sessions
A session is a group of processes that run under the control of a single user. Only a single session is active on a system and the user can only interact with the foreground (active) session. It contains a number of process groups where a process group has a process group ID and can contain a number of processes. A process can also contain a number of threads.
A new session is created by running the following command:
Processes
Within the Linux kernel, a computer program that can be run and scheduled is a process where each process is given a system unique identifier called a Process ID (PID). Every process on a system has a session-id which defines the session a process belongs to which is the session the process was started in (only system-daemons which are not attached to a session can spawn new sessions.)
A new process is typically started using the fork() system call and the newly created process is called the child process. The process that calls fork and creates the new child process is the parent process and the child and parent processes are executed concurrently. Furthermore, both the parent and child process will execute the next instruction following the fork() system call.
Threads
Linux implements all threads as standard processes — a thread is simply a process that shares certain resources with other processes. To Linux, threads are a manner of sharing resources between processes. Conversely, a process is basically a thread that does not share resources.
A process can have several threads and are created using the clone() system call with the CLONE_THREAD flag and are distinguished via a thread id (TID).
For example, a process that consists of four threads in Linux is four processes and are considered four normal task_struct structures where they are set up to share certain resources between them
Threads are created using the clone() system call which clones any subset of the process’s state.
References
https://www.win.tue.nl/~aeb/linux/lk/lk-10.html
https://www.baeldung.com/linux/process-vs-thread
https://www.baeldung.com/cs/process-vs-thread
https://www.csl.mtu.edu/cs4411.ck/www/NOTES/process/fork/create.html