View Single Post
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#87
Originally Posted by epage View Post
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.
Yes, of course, I was talking about overhead from the aspect of this particular app (the DBUS and other notification mechanism voodoo-s bring a twist or two in the story). Performance-wise, since 2.6 kernels, the difference is not as prominent as previously, but still, AFAIK the penalty for creating a new process is larger than it is to create a new thread. Now, if one is to do an 'exec', it doesn't really matter if it's a process or thread, it's expensive either way The gain is in small, fast, native, reentrant modules that can be checked often without a serious penalty and are easy to communicate with (no process level IPC), and threads are actually very good for that.
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc