Link with the parallel version of libstdc++ and take advantage of your multi-core processor “for free”
Going from a single threaded program to a parallel version is often a major pain, this is however often needed to take full advantage of modern multi-core processors. Having to work with threads, locks, and shared data structures is often difficult due to the non deterministic behavior of the scheduler and the difficulty in debugging the complex problems that can happen with multi-threading. It should be noted that several algorithms in the C++ library already have a parallel implementation. If…