The Weird Way Linux Creates Processes
178K views · Jan 20, 2026 · Science & Technology
Comments · 753
@CoreDumpped · 8 months ago · pinned
👉Get Rust training from Let’s Get Rusty: <a href="https://letsgetrusty.com/start-with-jorge">https://letsgetrusty.com/start-with-jorge</a>
13
@pixwarrior · 8 months ago (edited)
We need to create a child process!<br>Windows: Let's do that<br>Linux: Mitosis
2.2K
@mtxn · 8 months ago
fork(), depending on the system configuration, does not copy whole memory when executing new process; it's using COW (copy on write) approach. When value is changed in the child process it's just stops pointing to the parent's one and allocates new one in it's own address space
614
@XyndraNerd · 8 months ago
<a href="https://www.youtube.com/watch?v=SwIPOf2YAgI&t=114">1:54</a> lol nice detail on memory size between chrome and firefox
777
@koop_ss · 8 months ago
It's crazy how something can look complicated, but as soon as it's taught in a visual way, it becomes so much easier.<br>This channel is a gold mine, and I really appreciate the hard work you put into your presentations.
344
@zerto111 · 8 months ago
The game Factorio can utilize the fork on Linux to save the game without pausing it.<br>On Windows during an autosave the game pauses until the games state is written to disk.<br>On Linux the devs explained they can utilize fork which inherits the memory of the parent to save the game while the main process keeps running.<br>It increases memory usage for a short time. But you get a smoother experience.
80
@nullify. · 8 months ago
Oh boy, we going to talk about PID 1 next.
151
@nasheethahmeda817 · 8 months ago
at this point make a playlist for making our own OS by explaining all the implementation of existing OS's. Really looking forward to it.
60
@AJMansfield1 · 8 months ago
Also important to note, fork doesn't <i>actually</i> copy the underlying memory contents. It might seem like unix is doing redundant work there, especially if it's going to immediately overwrite the copied process with execve --- but the apparent "copy" is actually just a paper-thin illusion the kernel sets up via MMU shared pages.<br>For read-write memory areas, whichever fork first tries to write to its "copy" first might end up surprised to find that those read-write areas have been marked read-only --- except that the kernel catches that write-protection error before the process can even notice, and quickly makes an <i>actual</i> copy of just the modified page to switcheroo into the faulting process's page table before anyone notices. (Also, execve is smart enough to unmap and remap the memory pages instead of making the kernel do this switcheroo on every page.)<br>I'll also note that, to the keen eyed, it might then seem like it's <i>Windows</i> that ends up stuck making redundant extra copies in memory of the exact same worker process binary, but fortunately Windows has clever filesystem caching and page-mapping tricks of its own: processes running the same binary <i>still</i> end up sharing the same physical memory pages for their read-only program data. The specific runaround needed to make that happen isn't one I understand quite as well, and I suspect it's still a bit less efficient than fork; but if you <i>mean</i> to run multiple workers from the same shared program, you're meant to use CreateThread rather than CreateProcess.<br>(For sake of argument, I am of course ignoring systems with max-paranoia-level mitigations active for things like Spectre / Meltdown. In those configurations, you <i>do</i> just have hard copies.)<br>The real difference here is just that Unix prefers a small number of tightly-optimized abstractions that can handle multiple different use-cases, while Windows tends to provide multiple abstractions that are each more narrowly optimized, and leaves it to the programmer to pick the correct one.
10
@pheww81 · 8 months ago
I'm surprisingly by the first process being name P1 instead of P0
179
@Xylos144 · 8 months ago (edited)
<a href="https://www.youtube.com/watch?v=SwIPOf2YAgI&t=1000">16:40</a> in under 20 minutes we reached the genesis of process religion.
8
@beowulf4669 · 8 months ago
Looking forward to learning about init systems!<br><br>It seems that `fork() + execv()` is more flexible than Windows' approach, as fork can be used for much more than just subsequently spawing a subprocess. <br><br>If subprocess spawning is so frequent however, do you know why Unix systems didn't decide to provide an 'optimized' syscall to skip the process duplication part?
233
Up next

How Hardware Makes Threads Less of a Nightmare
Core Dumped · 100K views

The Question Nobody Ever Explains: Where Does the Kernel End?
Core Dumped · 309K views

How CPUs Run Functions
Core Dumped · 160K views

The Life of a Process
Ryan Baker · 69K views

Friday Night Database Recovery Crash Course (A True Story)
pouria · 336K views

The Filesystem is Awesome
Ryan Baker · 360K views

How History Shaped the Programming Terms We Still Use Today
Core Dumped · 150K views

How Real Projects Mix Compiled and Interpreted Languages
Core Dumped · 234K views

Bill Gates SHOCKED as Windows Users ABANDON Microsoft for Linux!
Tech With Tommy · 260K views

Simple Instructions, Weird Algorithms
Core Dumped · 112K views

It's Over: Bonds COLLAPSE to WORST Levels Since 2002 - Netherlands BANS Microsoft
House of El · 220K views

CONCURRENCY IS NOT WHAT YOU THINK
Core Dumped · 212K views

Every Time Travel Paradox, Explained
Deep Space Explainer and Space Dude · 6.9K views

Signals: Make Ctrl+C Do Anything You Want
Core Dumped · 120K views

How C Really Works
Cave of Programming · 214K views

Linux Full Course for Beginners | Learn Linux System Administration
Alpha Brains Courses · 183K views

Why Some Projects Use Multiple Programming Languages
Core Dumped · 1.5M views

How Does Linux Work? | Greg Kroah-Hartman
Wookash Podcast · 70K views

The Fancy Algorithms That Make Your Computer Feel Smoother
Core Dumped · 283K views

One Formula That Demystifies 3D Graphics
Tsoding · 1M views

Casey Muratori – The Big OOPs: Anatomy of a Thirty-five-year Mistake – BSC 2025
Better Software Conference · 902K views

What Happens When a Program Calls Sleeps?
Core Dumped · 335K views

Linux Kernel Internals: Process
Maple Circuit · 26K views

How Operating Systems ACTUALLY work (kernel mode vs. user mode)
Ben Dicken · 390K views

glibc - How does glibc make a system call in Linux?
VagabondLinux · 69K views

Linux processes, init, fork/exec, ps, kill, fg, bg, jobs
Engineer Man · 188K views