Re: Processes vs Threads

From: Casper H.S. Dik <casper_at_fwi.uva.nl>
Date: 2 Nov 1994 14:39:02 +0100
Message-ID: <3984pm$1es_at_mail.fwi.uva.nl>


psb_at_sambusys.demon.co.uk (Paul Beardsell) writes:

>Once upon a time a Unix fork() was expensive. And lite processes
>seemed a good idea. But not anymore. fork() takes no longer than
>pThreadCreate() (or whatever it is called - I can no longer remember.)

Fork() is still very expensive. More expensive than creating threads. Even the copy-on-write implementations are expensive (in the order of the size of the process forking plus a constant). You need to mark all read-write pages as copy-on-write. Stuff like share groups and rfork() are better in this respect and those can do anything you can do with threads.

Some things are threaded more easily than fork()ed (in the traditional way). Traditional fork()/mmap() also doesn't come with the locking necessary or with hideously expensive locking (the shm* case).

Casper Received on Wed Nov 02 1994 - 14:39:02 CET

Original text of this message