Unix IPC · Starter

The basics: what a thing is and what it's for.

Starter·15.1.1

What does 'IPC' stand for, and what is it used for?

Starter·15.1.2

What is a pipe in Unix, in its simplest form?

Starter·15.1.3

What is the key difference between a named pipe (FIFO) and an ordinary (anonymous) pipe?

Starter·15.1.4

What is a Unix domain socket typically used for?

Starter·15.1.5

What is a signal in Unix, and what is one common example?

Starter·15.1.6

What two syscalls are typically used together to create a new process and then have it run a different program?

Starter·15.1.7

What does the wait()/waitpid() family of syscalls let a parent process do?

Starter·15.1.8

What does dup2(oldfd, newfd) do, and why is it relevant to setting up IPC?

Starter·15.1.9

Besides its numeric exit status, what else can a terminated child process's wait status tell the parent?

Starter·15.1.10

What is the /proc filesystem (on Linux), and how is it related to inter-process visibility?

Starter·15.1.11

What does the kill() syscall actually do, despite its name?

Starter·15.1.12

What does SIGHUP ('hangup') conventionally signal to a process?

Starter·15.1.13

What is the basic purpose of flock() (an advisory file lock)?

Starter·15.1.14

What is the difference between an 'ephemeral' and a 'persistent' IPC object, using an anonymous pipe versus a named pipe (FIFO) as examples?

Starter·15.1.15

Why do filesystem permissions matter on a named pipe (FIFO) or a Unix domain socket's path, in a way they wouldn't for an anonymous pipe?

Starter·15.1.16

What does socketpair() provide, and how does it relate to a plain pipe?

Starter·15.1.17

At a high level, what is the fundamental difference between the 'message passing' and 'shared memory' IPC paradigms?

Starter·15.1.18

What happens to a child process whose parent exits (or is killed) before the child does, on a typical Unix system?

Starter·15.1.19

What is a process group, in the simplest terms, and why does it matter for signal delivery?

Starter·15.1.20

What happens to a process's already-open file descriptors (e.g. a pipe end) by default when that process calls fork()?

Starter·15.1.21

In TCP, what does the connection state TIME_WAIT mean?

Starter·15.1.22

In TCP, what does the connection state CLOSE_WAIT mean?

Starter·15.1.23

What tool is commonly used on Linux to see what TCP connection state (e.g. ESTABLISHED, TIME_WAIT, CLOSE_WAIT) a socket is currently in?

Starter·15.1.24

What does the TCP connection state LISTEN mean?

Starter·15.1.25

What does the TCP connection state ESTABLISHED mean?

Starter·15.1.26

At a basic level, what starts the process of closing a TCP connection?

Starter·15.1.27

Which side of a TCP connection -- the one that sends the FIRST FIN, or the one that receives it -- ends up going into TIME_WAIT?

Starter·15.1.28

Is a socket sitting in TIME_WAIT a sign of a bug in the application?

Starter·15.1.29

Is a large, steadily growing number of sockets stuck in CLOSE_WAIT a sign of a bug?

Starter·15.1.30

What is the TCP three-way handshake used to establish a connection?

Starter·15.1.31

What does the TCP state SYN_SENT mean?

Starter·15.1.32

If a server tries to restart and immediately re-bind to the same port it was just using, but gets an 'address already in use' error, what's a common underlying cause?

Starter·15.1.33

In plain terms, what is the basic difference between TIME_WAIT and CLOSE_WAIT?

Starter·15.1.34

Roughly speaking, does a TIME_WAIT socket still use significant memory or CPU on the machine holding it?

Starter·15.1.35

What is a basic, practical reason an application running a server might accumulate CLOSE_WAIT sockets?

Starter·15.1.36

What is one simple way to clear a pile of CLOSE_WAIT sockets stuck on a running process, short of fixing the underlying code bug?

Starter·15.1.37

Which of these is true about UDP compared to TCP regarding connection states like TIME_WAIT and CLOSE_WAIT?

Starter·15.1.38

What does RST (reset) mean when seen in TCP traffic or logs, in simple terms?

Starter·15.1.39

In the most basic sense, why can't an application just immediately reuse a port the instant a connection using it closes, with zero waiting at all?

Starter·15.1.40

What does the TCP state LAST_ACK mean?

Starter·15.1.41

Why would a server program want to wait on many open connections (file descriptors) at once, rather than handling them one at a time?

Starter·15.1.42

What does the select() system call do, in simple terms?

Starter·15.1.43

How does poll() differ from select() in basic usage?

Starter·15.1.44

What is epoll, in the simplest terms?

Starter·15.1.45

What does it mean for a file descriptor to be 'ready' in the context of select/poll/epoll?

Starter·15.1.46

At a basic level, what is the difference between a blocking and a non-blocking read() call?

Starter·15.1.47

What is io_uring, in the simplest terms?

Starter·15.1.48

In the simplest terms, what does 'kernel bypass' mean in networking?

Starter·15.1.49

Name one real example of a kernel-bypass networking technology.

Starter·15.1.50

Why might a system deliberately use kernel bypass networking instead of the normal kernel networking stack?

Starter·15.1.51

What is the 'C10K problem' referring to, roughly?

Starter·15.1.52

What is a well-known basic limitation of select() regarding how many file descriptors it can watch?

Starter·15.1.53

What does epoll_wait() basically do?

Starter·15.1.54

At a basic level, what is the difference between epoll's 'level-triggered' and 'edge-triggered' modes?

Starter·15.1.55

What does the basic epoll_create() / epoll_ctl() / epoll_wait() triplet represent?

Starter·15.1.56

Name one basic advantage io_uring is designed to have over epoll combined with ordinary read()/write() calls.

Starter·15.1.57

What are the submission queue (SQ) and completion queue (CQ) in io_uring's basic design?

Starter·15.1.58

Is epoll specific to Linux, or is it available on other operating systems like macOS and Windows in exactly the same form?

Starter·15.1.59

In the simplest terms, what is the basic tradeoff of using kernel bypass networking rather than the operating system's normal networking stack?

Starter·15.1.60

What does the term 'event loop' generally mean for a server built around select/poll/epoll?

Starter·15.1.61

What is a mutex, in the simplest terms?

Starter·15.1.62

What is a spinlock, in the simplest terms?

Starter·15.1.63

What is a condition variable used for?

Starter·15.1.64

What is a futex, in the simplest terms?

Starter·15.1.65

In the context of multiple threads sharing memory, what is a 'race condition'?

Starter·15.1.66

What is a 'critical section' in concurrent programming?

Starter·15.1.67

What is the basic difference between a binary semaphore and a mutex?

Starter·15.1.68

What is a deadlock, in the simplest terms?

Starter·15.1.69

What is priority inversion, described at a basic level?

Starter·15.1.70

What does it mean for an operation to be 'atomic' in the context of concurrent programming?

Starter·15.1.71

At a basic level, why do multiple threads sharing the same memory need synchronization primitives at all?

Starter·15.1.72

What does it mean for a thread to currently 'hold' or 'own' a lock?

Starter·15.1.73

What is a reader-writer lock, at a basic level?

Starter·15.1.74

What does 'busy-waiting' mean?

Starter·15.1.75

What does it mean for a synchronization primitive to be 'process-shared' rather than just thread-shared?

Starter·15.1.76

What typically happens if a thread tries to lock an ordinary (non-recursive) mutex that it is already holding itself?

Starter·15.1.77

What is a recursive mutex?

Starter·15.1.78

What do the POSIX functions sem_wait() and sem_post() basically do?

Starter·15.1.79

What is the basic difference between a named and an unnamed POSIX semaphore?

Starter·15.1.80

What is 'cache coherency,' at a basic conceptual level, in a multi-core system?

Starter·15.1.81

What does 'false sharing' mean, at a basic level?

Starter·15.1.82

What is a ticket lock, described at a basic level?

Starter·15.1.83

What is the basic difference between livelock and deadlock?

Starter·15.1.84

What is 'starvation,' in the context of locks and scheduling?

Starter·15.1.85

What does POSIX shared memory (via shm_open()) basically provide?