effective c++
[EMCpp]Item-35 Prefer Task-Based Programming to Thread-Based
· β˜• 3 min read

Thread-based programming calls for manual management of thread exhaustion, oversubscription, load balancing, and adaptation to new platforms, while task-based programming via std::async with the default launch policy handles most of the issues for us.


[EMCpp]Item-31 Avoid Default Capture Modes
· β˜• 3 min read

Default by-reference capture can lead to dangling references; default by-value capture is susceptible to dangling pointers, while misleadingly susggests the lambdas are self-contained.