Apart from the discussions and presentations what should go into the next C++ standard (called C++0x and scheduled for 2009), one of the big topics was concurrency and a new awareness that some new ideas are needed. Herb Sutter presented the points of his recent DDJ article. As an example for an exercise simple to understand and yet far from easy to solve he mentioned the Santa Claus Problem:
Santa repeatedly sleeps until wakened by either all of his nine reindeer, back from their holidays, or by a group of three of his ten elves. If awakened by the reindeer, he harnesses each of them to his sleigh, delivers toys with them and finally unharnesses them (allowing them to go off on holiday). If awakened by a group of elves, he shows each of the group into his study, consults with them on toy R&D and finally shows them each out (allowing them to go back to work).
Santa should give priority to the reindeer in the case that there is both a group of elves and a group of reindeer waiting. (Description taken from here)
According to Sutter there is no simple solution known yet. And even using mature frameworks like Java and .NET doesn’t guarantee a deadlock free program, because nobody knows yet how to compose separate deadlock-free components into a bigger deadlock-free program.
At least two other talks covered concurrency too. In the Python track Michael Sparks presented Kamaelia and explained that they chose to implement concurrency with cooperative multitasking using generators. And in the very last talk of the conference Detlev Vollmann considered threads as harmful. Detlevs point was that even widely respected authors don’t get multithreading right, how should an ordinary developer be able to succeed? He explored using cooperative multitasking (suitable only for small projects) and using processes instead of threads, because with processes no data is implicitly shared. This was a lively and interesting talk with much discussion. Unfortunately I had to leave early to catch my flight and I missed the last 15 minutes, but I don’t expect that the problems were solved in these 15 minutes.
Perhaps the most important fact to remember: sharing data between processes or threads should be avoided when possible.