[e-lang] [Fwd: Threads are not only evil, they're unusable]

Mark Miller markm at cs.jhu.edu
Mon Nov 29 00:15:37 EST 2004


[Forwarded by permission.]

-------- Original Message --------
Subject: Threads are not only evil, they're unusable
Date: Tue, 23 Nov 2004 14:02:07 -0800
From: Karp, Alan H <alan.karp at hp.com>
To: Mark Miller <markm at cs.jhu.edu>

Threads Cannot be Implemented as a Library

Boehm, Hans-J.

HPL-2004-209
20041122
External

Keyword(s): threads; library; register promotion; compiler optimization;
garbage collection

Abstract: In many environments, multi-threaded code is written in a
language that was originally designed without thread support (e.g. C),
to which a library of threading primitives was subsequently added. There
appears to be a general understanding that this is not the right
approach. We provide specific arguments that a pure library approach, in
which the compiler is designed independently of threading issues, cannot
guarantee correctness of the resulting code. We first review why the
approach almost works, and then examine some of the surprising behavior
it may entail. We further illustrate that there are very simple cases in
which a pure library-based approach seems incapable of expressing an
efficient parallel algorithm. Our discussion takes place in the context
of C with Pthreads, since it is commonly used, reasonably well
specified, and does not attempt to ensure type-safety, which would
entail even stronger constraints. The issues we raise are not specific
to that context.

Read more at [<http://www.hpl.hp.com/techreports/2004/HPL-2004-209.html>].
[...]
________________________
Alan Karp
Principal Scientist
Virus Safe Computing Initiative
Hewlett-Packard Laboratories
1501 Page Mill Road
Palo Alto, CA 94304
(650) 857-3967, fax (650) 857-7029
https://ecardfile.com/id/Alan_Karp
http://www.hpl.hp.com/personal/Alan_Karp



-- 
Text by me above is hereby placed in the public domain

     Cheers,
     --MarkM



More information about the e-lang mailing list