core_dump_guide.pdf
4.2 KB
A short summary of what 'core dump" is, where is it used ? why and when we get a core dump ? and so on.
#notes #coredump @tCafeLinux👩🚀
Please open Telegram to view this post
VIEW IN TELEGRAM
_Bool in C 👨💻
Do we have BOOL in C ?
We do have! and it is widely used in modern embedded projects for better readability, btw many low-level codes still use 0/1 instead of BOOL due to older compiler support, or coding standards.
Since C99:
#cprogramming #notes #boolean @tcafeLinux
Do we have BOOL in C ?
We do have! and it is widely used in modern embedded projects for better readability, btw many low-level codes still use 0/1 instead of BOOL due to older compiler support, or coding standards.
Since C99:
#include <stdbool.h>
bool flag = false;
if (!flag) {...}
bool is a MACRO for _Bool
You can also use _Bool like this:
_Bool flag = false;
#cprogramming #notes #boolean @tcafeLinux
Please open Telegram to view this post
VIEW IN TELEGRAM
- 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