Re: Advantages of fork over thread?
- From: "fei.liu@xxxxxxxxx" <fei.liu@xxxxxxxxx>
- Date: 12 Jul 2006 11:40:13 -0700
Pascal Bourguignon wrote:
"fei.liu@xxxxxxxxx" <fei.liu@xxxxxxxxx> writes:
Hi Group, I am weighting the pros and cons of fork and thread in an
application design.
fork,
pros: per process resource, per process security, portability
cons: slightly more memory use, slightly more expensive context
switch, IPC (mmap) to communicate among processes
thread,
pros: automatically shared global and heap memory, faster context
switches
cons: portability, security (threads are too well mixed), per thread
resource is less.
Please share your insights. Thanks,
The main question you have to answer, is what you want when one context crashes?
If you want all of the contexts of your application to crash at the
same time, then you want threads.
If you want only that context to crash, and the other to go on, then
you want processes.
--
__Pascal Bourguignon__ http://www.informatimago.com/
You never feed me.
Perhaps I'll sleep on your face.
That will sure show you.
I don't see why I cannot tolerate one context crash in the thread
model. Can you elaborate on that? Equally I can also allow the entire
process group to die if there is a single context crash.
.
- Follow-Ups:
- Re: Advantages of fork over thread?
- From: Pascal Bourguignon
- Re: Advantages of fork over thread?
- References:
- Advantages of fork over thread?
- From: fei.liu@xxxxxxxxx
- Re: Advantages of fork over thread?
- From: Pascal Bourguignon
- Advantages of fork over thread?
- Prev by Date: Re: Advantages of fork over thread?
- Next by Date: semaphore/mutex to control aio
- Previous by thread: Re: Advantages of fork over thread?
- Next by thread: Re: Advantages of fork over thread?
- Index(es):
Relevant Pages
|
|