Linux OS Internals (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
What is the difference between a Process and a Thread in Linux?
junior Levellinux-osBasic
In Simple Words:
- Process: An independent instance of an executing program with its own isolated virtual address space, file descriptors, and environment variables. Created via
fork(). - Thread: An execution unit inside a process. Multiple threads share the same address space, heap memory, and open file descriptors of their parent process.
- Linux Kernel Perspective (
task_struct): To the Linux kernel, both processes and threads are represented identically as tasks (task_struct). A thread is simply a task created withclone()sharing memory flags (CLONE_VM,CLONE_FILES).