3

continuing the question in why is boost lockfree freelist size is limited to a maximum of 65535 objects?

How to increase the size of the queue in case of 64 bit machine.

typedef boost::lockfree::queue<int, boost::lockfree::fixed_size<true>> MyQueue;
MyQueue queue(1024*100); << how to increase the size to more than 65534?

Boost implementation adds extra tag bits to the queue item to avoid the ABA problem. Currently it uses 32 bits value (16 bits for pointer and 16 bits for tag).

How can i change it to use 64 bit value (32 bits for pointer and 32 bits for tag)?

is it enough to change the tagged_index::tag_t and index_t to ba based in unin32_t?

Community
  • 1
  • 1
weima
  • 3,929
  • 5
  • 30
  • 51
  • 2
    http://stackoverflow.com/a/14957828/688659 (answer from the implementer himself, Tim Blechmann) "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." – gx_ Aug 20 '13 at 08:15
  • 1
    thanks, thats exactly what i want to know. what changes to make. – weima Aug 20 '13 at 08:26

1 Answers1

1

As pointed out, the answer is here: https://stackoverflow.com/a/14957828/1065190 (written by the implementer, Tim Blechmann):

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.

Community
  • 1
  • 1
Sergey K.
  • 23,426
  • 13
  • 95
  • 167