View Single Post
epage's Avatar
Posts: 1,684 | Thanked: 1,562 times | Joined on Jun 2008 @ Austin, TX
#86
Originally Posted by attila77 View Post
No, no, threads and processes are very different things. A thread is 'just' a separate thread of control in an application (all resources shared), while processes are completely isolated (shared memory notwithstanding). You can start literally thousands of threads in a second as nothing time/memory intensive 'needs to happen' as opposed to processes (which take up memory for their libs and data)..
Below is my understanding, please correct if wrong:

The simplistic way to look at it is that threads and process are implemented on top of the same model. The main difference is whether a Copy-On-Write flag is set or not on the page tables.

I'd imagine if you just do a "fork"/"exec" then you end up losing all gains COW gains you. So I would guess the overhead is dependent purely on what you do with the process after the fork.
__________________
770, n810, n900, Ideapad S10-3t
TheOneRing, DialCentral, Gonvert, Quicknote, Multilist, ejpi, nQa, Waters of Shiloah
Programming Blog