Linux in Action (David Clinton) (Z-Library).pdf
17 MB
#Linux💻 in Action.
A comprehensive resource for learning Linux and its administration.
#ebook #cafelinux @tcafeLinux
Please open Telegram to view this post
VIEW IN TELEGRAM
❤🔥4
- A NOTE on Threading in Linux -
⭕️ ⭕️ ⭕️ ⭕️ ⭕️ ⭕️ ⭕️
Regarding "threads are actually processes" in Linux:
This is referring to Linux's specific implementation detail. Most operating systems implement threads and processes as fundamentally different entities at the kernel level. But Linux takes a different approach:
In the Linux kernel, there's really only one type of execution unit - what it calls a "task"
When you create a process, you get a task
When you create a thread, you also get a task - but this task shares certain resources (like memory space, file descriptors, etc.) with the parent task
The kernel doesn't distinguish between "threads" and "processes" - it just sees tasks with different levels of resource sharing
So when you call pthread_create() to make a thread, Linux internally calls clone() (similar to fork()) but with flags that specify which resources should be shared between the parent and child tasks. A "thread" is just a task that shares most resources with its parent, while a "process" is a task that has its own separate resources.
This is why if you run ps -eLf on Linux, you'll see individual entries for each thread - because to the kernel, they're just separate tasks that happen to share memory.
#notes #threading #linux #cprogramming💻 👨💻 @TCAFELINUX
Please open Telegram to view this post
VIEW IN TELEGRAM