Threads Considered Harmful

Threads Considered Harmful. A little known anecdote is that after Dijkstra’s famous paper in “Communications of the ACM” titled “Goto Considered Harmful”, and after the reactions, the ACM has adopted a policy of not allowing papers with “… Considered Harmful” in the title. It seems it decided such papers are inherently inciting. Thus, Goto has a position of sole infamy in the history of the ACM. Nonetheless, if ever a feature has been easy to compare to Goto in its destructiveness, threads would be that feature. Threads are, in a sense, “the goto that keeps on giving”: once you have spawned a thread, there is no way to know anymore which line is being executed in parallel with yours — at least not with a lot of careful locking that a moment’s neglectfulness proves useless. When deciding to spawn a thread, you are conciously giving up any and all protection your language gives you from making stupid mistakes. The rest of the paper will try to convince you that while there is a limited class of problems for which threads are a good solution, your problem is almost certainly not among them — no matter what your problem is. [kuro5hin.org]

See also: links to similarly-provocative

presentation by John Ousterhout

and

message by Tom Christiansen
.

Leave a Reply