Microsoft.Isam.Esent.Interop.MemoryCache.GetStartingOffset C# (CSharp) Method

GetStartingOffset() private method

Get the offset in the cached buffers array to start allocating or freeing buffers to. This is done so that all threads don't start operating on slot zero, which would increase contention.
private GetStartingOffset ( ) : int
return int
        private int GetStartingOffset()
        {
            // Using the current CPU number would be ideal, but there doesn't seem to
            // be a cheap way to get that information in managed code.
            return Thread.CurrentThread.ManagedThreadId % this.cachedBuffers.Length;
        }