logoalt Hacker News

cowlevel • yesterday at 7:47 PM • 0 replies • view on HN

Still doesn't. The Linux kernel makes no distinction between threads and processes. What we commonly call "processes" are in fact "thread groups" and play a minor role, mostly related to signal handling and the ability to exit them all at once with a syscall.

The clone syscall allows you to fork a thread with varying levels of sharing. Usually a thread library will share almost everything and a process fork will share almost nothing, but those aren't the only choices. Yu can choose, say, to duplicate the memory map but share the file descriptor table.