from: https://github.com/imzhenyu/cpp11-on-multicore
originally from: https://github.com/preshing/cpp11-on-multicore with certain changes
