On Linux, pthread_create() et al. implemented as part of the glibc project. It uses (not portable, specific for Linux) syscall clone() . (Linux fork() also implemented in terms of clone() ). Some of the BSDs also have a similar syscall called rfork() .
I understand that clone() or rfork() will create a new process, but you can specify a flag that says: βUse copy-to-write semantics to give this a different address space.β So, if you want fork() , you specify this flag, but if you want to create a stream, you will not do this, and you will get a common address space.
(edited for more details)
source share