c++ - why is boost lockfree freelist size is limited to a maximum of 65535 objects? -
why boost lockfree size fixed 65535 objects?
typedef boost::lockfree::queue<int, boost::lockfree::fixed_size<true>> myqueue; myqueue queue(1024*100);
the above code throws exception.
the reasoning find in code array-based freelists support 16bit address space.
what reason this? using on 64bit linux machine. why limit addressing 2**16 items? queue use 'short int' indexing? atomic instructions work 16bit word size?
what should have fixed sized queue more capacity this?
boost implementation of lockfree list has fight aba problem. common workaround add tag
bits quantity being considered. furthermore, boost has run on 32-bit architecture, means 32-bit values can manipulated atomically.
and if split 32-bit value can store 16-bit pointers , 16-bit tag. unsigned 16-bit values limited 65535 different values.
Comments
Post a Comment