C# 클래스 Ariadne.Counter

A counter designed for highly concurrent use.
This counter tends to be appreciably slower than using Interlocked.Increment(ref int) when there is little contention. However, it is much faster in the face of contending threads, with the comparable cost of Interlocked.Increment(ref int) increasing nearly exponentially to the number of contending threads.
파일 보기 프로젝트 열기: JonHanna/Ariadne

공개 메소드들

메소드 설명
Counter ( ) : System

Creates a new Counter with an initial value of zero.

Counter ( int startingValue ) : System

Creates a new Counter with an initial value of startingValue.

Decrement ( ) : void

Atomically decrements the Counter by one.

Increment ( ) : void

Atomically increments the Counter by one.

operator ( ) : Counter

Atomically increments counter by one.

비공개 메소드들

메소드 설명
GetIndex ( ) : int

메소드 상세

Counter() 공개 메소드

Creates a new Counter with an initial value of zero.
public Counter ( ) : System
리턴 System

Counter() 공개 메소드

Creates a new Counter with an initial value of startingValue.
public Counter ( int startingValue ) : System
startingValue int The initial value for the .
리턴 System

Decrement() 공개 메소드

Atomically decrements the Counter by one.
public Decrement ( ) : void
리턴 void

Increment() 공개 메소드

Atomically increments the Counter by one.
public Increment ( ) : void
리턴 void

operator() 공개 정적인 메소드

Atomically increments counter by one.
public static operator ( ) : Counter
리턴 Counter