Erlang (mild) PL buzz

David Hopwood david.nospam.hopwood@REDACTED
Wed Jul 20 16:11:16 CEST 2005


Michael Williams wrote:
> In article <20050720091222.13666.qmail@REDACTED>,
>  thomasl_erlang@REDACTED (Thomas Lindgren) writes:
> 
> |> Threads Cannot Be Implemented As A Library, Hans-J. Boehm.
> 
> Interesting paper, but somewaht far from reality. Anyone who programmed
> a concurrent application as shown in the examples in this paper would
> need their heads examined. Even in C...

There are essentially two parts to the paper: sections 1-4 which talk
about problems with the specification of pthreads and interactions with
compiler optimizations, and section 5 which argues for lock-free
programming facilities in C/C++.

I agree that anyone who tries to use lock-free primitives for general
application programming needs their head examining. (This does not apply
to using lock-free primitives to implement higher-level concurrency
primitives in languages and operating systems.)

However, the first part of the paper is completely on-target about the
inadequacy of the pthreads specification. For example:

# The current Pthreads specification explicitly allows [word tearing],
# without any restriction on the field types. By our reading, it even
# allows it for adjacent global variables outside of a struct declaration.
# Since linkers may, and commonly do, reorder globals, this implies that
# an update to any global variable may potentially read and rewrite any
# other global variable.
# We do not believe that any interesting Pthreads programs can be claimed
# to be portable under these rules.

-- 
David Hopwood <david.nospam.hopwood@REDACTED>




More information about the erlang-questions mailing list