C# Класс Microsoft.HockeyApp.Extensibility.Implementation.WeakConcurrentRandom

Random generator creating “sufficiently random” integers, which is faster than to initializes a new instance of the GUID structure, and uses 8 bytes only for the id instead of 16.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Initialize ( ) : void

Initializes generator with a set of random numbers.

Initialize ( IRandomNumberBatchGenerator>.Func randomGeneratorFactory, int segmentIndexBits, int segmentBits ) : void

Initializes generator with a set of random numbers.

Next ( ) : ulong

Weakly thread safe next (random) operation id generator where 'weakly' indicates that it is unlikely we'll get into collision state.

WeakConcurrentRandom ( ) : System

Initializes a new instance of the WeakConcurrentRandom class.

Приватные методы

Метод Описание
RegenerateSegment ( int newIndex ) : void

Generates random number batch for segment which just exhausted according to value of the new index.

Описание методов

Initialize() публичный Метод

Initializes generator with a set of random numbers.
public Initialize ( ) : void
Результат void

Initialize() публичный Метод

Initializes generator with a set of random numbers.
public Initialize ( IRandomNumberBatchGenerator>.Func randomGeneratorFactory, int segmentIndexBits, int segmentBits ) : void
randomGeneratorFactory IRandomNumberBatchGenerator>.Func Factory used to create random number batch generators.
segmentIndexBits int Number of significant bits in segment index, i.e. value of 3 means 8 segments of random numbers - 0..7.
segmentBits int Number of significant bits in random number index within segment, i.e. value of 10 means 1024 random numbers per segment.
Результат void

Next() публичный Метод

Weakly thread safe next (random) operation id generator where 'weakly' indicates that it is unlikely we'll get into collision state.
public Next ( ) : ulong
Результат ulong

WeakConcurrentRandom() публичный Метод

Initializes a new instance of the WeakConcurrentRandom class.
public WeakConcurrentRandom ( ) : System
Результат System