5 ms·
No because IIRC the Python multiprocessing package uses fork rather than threads.
by draegtun 17y ago
No because IIRC the Python multiprocessing package uses fork rather than threads.
- mahmud 17y agoIn 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.
- nas 17y agoOn plaforms without fork it uses threads (e.g. windows). Why do you care if it is using fork() anyhow?
- draegtun 17y agoThats a question you should be asking the multiprocessing module guys ;-)