Aug 232012
 

Some modern languages claim to have better concurrency support than languages like Java or C/C++ (Go, Erlang, etc.).  Their features are often touted as making it easier to “get concurrency right,” as though it’s somehow difficult to have similar capabilities in other languages.  Sometimes this sounds to me like the closures vs. objects debate.

To demonstrate what I mean, here’s one way to implement a Go-style message channel for inter-thread communication in C++ (using C++11’s thread support):

Continue reading »