Re: Processes vs Threads

From: Andrew Francis <andrew_at_gmvt4.concordia.ca>
Date: 7 Nov 1994 13:31:50 GMT
Message-ID: <39la86$5p7_at_newsflash.concordia.ca>


In article <784051057snz_at_sambusys.demon.co.uk> psb_at_sambusys.demon.co.uk writes:

In article <3984pm$1es_at_mail.fwi.uva.nl> casper_at_fwi.uva.nl "Casper H.S. Dik" writes:

CD>Fork() is still very expensive. More expensive than creating threads. CD>Even the copy-on-write implementations are expensive (in the order

[lines deleted]

PB>Tell me what pThreadCreate() doesn't do that fork() does do?

   First thing I can think the pthread_create() doesn't do is create a new Unix process.

PB>What locking can threads do than is cheaper than semaphores used by PB>co-operating Unix processes?

   Unix System V style semaphores are expensive since atomicity is ensured by storing semaphores and manipulating them in the kernel. Since the Unix kernel cannot be interrupted, this is safe. However this makes semaphores costly. Also, Unix semaphores are very awkward and difficult to use. Since I believe most thread packages try to avoid making system calls, they will be faster. I expect them to be considerable faster.

--Andrew Received on Mon Nov 07 1994 - 14:31:50 CET

Original text of this message