Summary Dialogue on Concurrency
Professor: So, does your head hurt now?
Student: (taking two Motrin tablets) Well, some. It's hard to think
about all the ways threads can interleave.
Professor: Indeed it is. I am always amazed at how so few line of code,
when concurrent execution is involved, can become nearly impossible
Student: Me too! It's kind of embarrassing, as a Computer Scientist,
not to be able to make sense of five lines of code.
Professor: Oh, don't feel too badly. If you look through the first papers
on concurrent algorithms, they are sometimes wrong! And the authors
Student: (gasps) Professors can be ... umm... wrong?
Professor: Yes, it is true. Though don't tell anybody it's one of our
Student: I am sworn to secrecy. But if concurrent code is so hard to
think about, and so hard to get right, how are we supposed to write
correct concurrent code?