On 16/01/2014 07:32, Quoth Alexander Krizhanovsky:
Otherwise I'm wondering if it has sense to integrate the queue implementation into boost::lockfree?
The algorithm description is available at http://www.linuxjournal.com/content/lock-free-multi-producer-multi-consumer-...
I've only had a quick glance at it, but it looks less general-purpose -- it appears that for each queue instance, you need to predefine an upper bound on the number of producer and consumer threads and assign each thread a unique id within that bound. (Also, given the apparent locality of the thread-id, I don't like that it is stored and accessed as a thread-global; this would complicate use of multiple queues from one thread. And interleaving the per-thread head/tail indexes seems vulnerable to false sharing.) There are still many cases where manually assigning thread ids is achievable, so something like this might be useful to have. But it couldn't be a replacement for the more general queue.