Hacker News new | past | comments | ask | show | jobs | submit login
Extend the life of threads with synchronization (C++11) (stackoverflow.com)
16 points by indatawetrust on July 2, 2016 | hide | past | favorite | 1 comment



My two cents -- just use Cilk Plus: https://www.cilkplus.org/tutorial-cilk-plus-keywords#spawn_a...

Why I like it:

- easy to learn (3 keywords total: cilk_spawn, cilk_sync, cilk_for)

- runtime handles thread creation, deciding appropriate number of threads based on hardware

- provably efficient work-stealing scheduler

- natively supported in GCC 5, branches available for GCC 4.8/4.9 and Clang

- comes with a race detector (guaranteed to discover determinacy/data races)

- trivial to convert your parallel code to serial (#define spawn/sync keywords -> empty string, and cilk_for -> for)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: