Processes

2 Posts

Why Inter-Process Communication Is More Than Passing Data

8 minute

Process isolation solves an important problem: if one process corrupts its own memory, it usually does not directly corrupt another process.

But isolation creates another problem: two processes cannot share ordinary variables like two threads can. A pointer inside one process usually means nothing inside another process. Once a system is split into multiple processes, IPC, or inter-process communication, becomes necessary.

IPC is often understood as “send data from A to B.” That is only part of it.

Read More

What Is the Difference Between a Process, a Thread, and an RTOS Task?

9 minute

Many concurrency bugs start with one overloaded word: task.

On Linux, people say “start a process.” In application frameworks, they say “create a thread.” In an RTOS, they often say “create a task.” All three sound like “make some code run at the same time,” but their resource boundaries are very different.

If they are only understood as “units of code execution,” engineering judgment quickly goes wrong. Why can one thread crash an entire process? Why can two processes not directly access each other’s variables? Why is sharing global variables between RTOS tasks so common? Why are Linux process switches and thread switches not exactly the same cost?

Read More