|
The
Ptolemy II system itself began to be widely used, and every use of the system
exercised this code. No problems were observed until the code deadlocked on
April 26, 2004, four years later.
It is
certainly true that our relatively rigorous software engineering practice
identified and fixed many
concurrency bugs. But the fact that a problem as serious as a deadlock that
locked up the system
could go undetected for four years despite this practice is alarming. How many
more such problems
remain? How long do we need test before we can be sure to have discovered all
suchproblems?
Regrettably, I have to conclude that testing
may never reveal all the problems in nontrivial multithreaded code.
Conclusion
Concurrency
in software is difficult. However, much of this difficulty is a consequence of
the abstractions for concurrency that we have chosen to use. The dominant one
in use today for generalpurpose computing is threads. But non-trivial
multi-threaded programs are incomprehensible to humans. It is true that the
programming model can be improved through the use of design patterns, better
granularity of atomicity (e.g. transactions), improved languages, and formal
methods.
However,
these techniques merely chip away at the unnecessarily enormous nondeterminism
of the threading model. The model remains intrinsically intractable.
If we
expect concurrent programming to be mainstream, and if we demand reliability
and predictability from programs, then we must discard threads as a programming
model. Concurrent programming models can be constructed that are
much more predictable and understandable than threads. They are based on a very
simple principle: deterministic ends should be accomplished with deterministic means. Nondeterminism should
be judiciously and carefully introduced where needed, and should be explicit in
programs. This principle seems obvious, yet it is not accomplished by threads.
Threads must be relegated to the engine room of computing, to be suffered only by
expert technology providers.
Download Paper @ http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-1.pdf
|