4 ms·
In Linux they're identical :-)
by mahmud 17y ago
In Linux they're identical :-)
- duskwuff 17y agoNoo... fork() gives you a separate address space, whereas threads would require that you share an address space with the parent. vfork() and clone() can almost give you what you want, but Linux threading is using something different (NPTL) nowadays.
- mahmud 17y agoYou're correct. My position was that in Linux, threads weigh just as much as processes; the forking speed is identical, and extremely fast with COW. Compared to other OSes where processes and threads are completely different beasts. Even with NPTL, both processes and threads have task_structs.
- thwarted 17y agoNPTL uses clone(2). fork(2) is implemented in terms of clone(2) also.