A quick way to map unordered list of longs to buffer location ?
- by alhazen
I have a large number of points (indexed by long) that are processed by multiple threads and I'm using a buffer to hold the output results in order. As the number of points processed is huge, what would be an efficient way to map the indexes of the points to the corresponding ordered position in the buffer ?
Example:
long bufferIndex bufferIndex
index (if BufferSize = 2) (if BufferSize = 4)
----------------------------------------------
2938 0 0
2939 1 1
2941 1 3
2940 0 2
Thanks.