Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The use of std::mutex (especially in frequently accessed structures) will bring your application to a grinding halt.

Not necessarily. It really depends on your problem domain and how you architected your solution.

For example, a basic producer-consumer can suffer if you implement it with a common non-thread safe task queue where all consumers and producers have to lock a mutex to push/pop. However, adopting a queue whose pushes and pops can be performed independently without any contention, and using work-stealing consumers that manage their own work queue are enough to eliminate contention to a residual level.

It all depends on your problem domain and how much time and effort and thought you're willing to invest in a problem.



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

Search: