Hacker News new | past | comments | ask | show | jobs | submit login

> PG maintains a pool of pre-forked processes so there is typically no process startup delay.

Nope, we don't. You can use an external connection pooler like pgbouncer to achieve that however.

> Shared memory regions and SysV cross-process locks facilitate IPC. Back in the day this is how threads were done in user-land:

Well, that's how IPC is/was done in case of multiple processes. I'd not call that threading however, that'd imo require at least a single process space (i.e. shared virtual memory space).

The big advantage of processes is increased isolation. I.e. problems in one process are much likely to affect others, there's less locking required (e.g. in the memory allocator for local memory allocations, internally for mmaps and such). The big disadvantage is that dynamically scaling the amount of shared memory is quite ugly in multi-process models. It's hard to portably allocate shared memory after the fact and guarantee it's mapped at the same address in all processes, thereby making pointer usage hard/impossible.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: