Difference between user-level and kernel-supported threads?

Edit: The question was a little confusing, so I’m answering it two different ways. OS-level threads vs Green Threads For clarity, I usually say “OS-level threads” or “native threads” instead of “Kernel-level threads” (which I confused with “kernel threads” in my original answer below.) OS-level threads are created and managed by the OS. Most languages … Read more

What is `S_ISREG()`, and what does it do?

S_ISREG() is a macro used to interpret the values in a stat-struct, as returned from the system call stat(). It evaluates to true if the argument(The st_mode member in struct stat) is a regular file. See man stat, man fstat or man inode (link to inode man page) for further details. Here’s the relevant part … Read more

Why should we check WIFEXITED after wait in order to kill child processes in Linux system call?

wait returning >= 0 tells you a child process has terminated (and that calling wait didn’t fail), but it does not tell you whether that process terminated successfully or not (or if it was signalled). But, here, looking at your code, it’s fairly obvious the program does care about whether the child process that terminated did so successfully or not: … Read more

Difference between word addressable and byte addressable

A byte is a memory unit for storage A memory chip is full of such bytes. Memory units are addressable. That is the only way we can use memory. In reality, memory is only byte addressable. It means: A binary address always points to a single byte only. A word is just a group of bytes – 2, 4, 8 depending upon the data bus size of the CPU. To understand the memory operation fully, you must be familiar with the various registers of the CPU and the memory ports of the RAM. I assume … Read more

What are the difference between macOS and iOS?

A macOS and iOS share many of the same frameworks, low level (kernel) code, and share a common kernel and several core components. You can read about that in the following Wikipedia article: Darwin (operating system) However when it comes to their differences, it became a bit more complicated to find out. Can anyone help … Read more