aeron
aeron copied to clipboard
Consider changing tail offset to be number of frame alignments
Rather than have the tail offset which is incremented on publication claim be the byte offset in the term it can be the number of frame alignments, currently 32-byte alignment, so that it gives a greater margin for error if many concurrent threads where to pass pass under the publication limit at exactly the same time to increment the tail and cause overflow.
For the publication to fail currently it would take 192 threads to be at the same point and term buffers to be 1GB length, with each claiming the maximum 16MB message length, for overflow to happen. Each division of the term length by 2 doubles the number of threads required for overflow at maximum message length.
Sounds a bit like compressed oops, based on a similar observation on alignment, and with a similar (minor) overhead of "uncompressing" the offset. Cool idea :)
Credit should go to @goglusid for the observation.