I currently have a code written using C++ 11 thread support library: http://en.cppreference.com/w/cpp/thread

I am wondering whether it would be safe to mix that code with boost::lockfree. http://www.boost.org/doc/libs/1_54_0/doc/html/lockfree.html

That is, I want multiple C++11 std::threads to concurrently access boost::lockfree::queue. Probably it would be safer to replace C++11 thread with boost::thread, but if I could minimize the code change it would be nice.

有帮助吗?

解决方案

I am currently working on a threadpool implementation myself using a lockfree queue and std::thread however I am using the Joe Seigh atomic queue algorithm rather than the boost version. I can see no reason why the boost version would not be fine, I've examined the source and it seems an excellent implementation to me.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top