Trouble with boost::lockfree::queue in shared memory (boost 1.53, gcc 4.7.2 / clang 3.0-6ubuntu3)

前端 未结 1 609
庸人自扰
庸人自扰 2020-12-19 03:48

I have a problem with placing boost::lockfree::queue<, ..> in shared memory. I need it because I have to be able to insert

相关标签:
1条回答
  • 2020-12-19 04:13

    using boost::lockfree::queue or boost::lockfree::stack in shared memory is limited to 65535 elements, for compatibility reasons. if you have a single-producer, single-consumer use-case, you might want to use the boost::lockfree::spsc_queue. however this is also not dynamically-sized.

    reason for this is limitation is 32bit compatibility. for 64bit platforms one might be able to adapt the boost.lockfree code to use 32bit instead of 16bit indices. but it would require some non-trivial changes to implement things correctly.

    0 讨论(0)
提交回复
热议问题