App.Metrics.Concurrency
Initializes a new instance of the struct.
The value.
Returns the current value of the instance and sets it to zero as an atomic operation.
The current value of the instance.
Returns the latest value of this instance written by any processor.
The latest written value of this instance.
Increment this instance and return the value after the increment.
The value of the instance *after* the increment.
Increment this instance with and return the value after the increment.
The value.
The value of the instance *after* the increment.
Array of ints which provides atomic operations on the array elements.
Gets the length of the underlying array
The length.
Returns the size in bytes occupied by an AtomicIntArray instance.
instance for whch to calculate the size.
The size of the instance in bytes.
Add to this instance and return the resulting value.
index in the array
The amount to add.
The value of this instance + the amount added.
Replace the value of this instance, if the current value is equal to the value.
index in the array
Value this instance is expected to be equal with.
Value to set this instance to, if the current value is equal to the expected value
True if the update was made, false otherwise.
Decrement this instance and return the value after the decrement.
index in the array
The value of the instance *after* the decrement.
Decrement this instance with and return the value after the decrement.
index in the array
value to decrement with
The value of the instance *after* the decrement.
Add to this instance and return the value this instance had before the add operation.
index in the array
The amount to add.
The value of this instance before the amount was added.
Decrement this instance and return the value the instance had before the decrement.
index in the array
The value of the instance *before* the decrement.
Decrement this instance with and return the value the instance had before the decrement.
index in the array
value to decrement with
The value of the instance *before* the decrement.
Increment this instance and return the value the instance had before the increment.
index in the array
The value of the instance *before* the increment.
Increment this instance with and return the value the instance had before the increment.
index in the array
value to increment with
The value of the instance *before* the increment.
Returns the current value of the instance and sets it to zero as an atomic operation.
index in the array
The current value of the instance.
Returns the current value of the instance and sets it to as an atomic operation.
index in the array
value that will be set in the array at
The current value of the instance.
Returns the latest value of this instance written by any processor.
index in the array
The latest written value of this instance.
Increment this instance and return the value after the increment.
index in the array
The value of the instance *after* the increment.
Increment this instance with and return the value after the increment.
index in the array
value to increment with
The value of the instance *after* the increment.
Returns the current value of the instance without using Volatile.Read fence and ordering.
index in the array
The current value of the instance in a non-volatile way (might not observe changes on other threads).
Set the value without using Volatile.Write fence and ordering.
index in the array
The new value for this instance.
Write a new value to this instance. The value is immediately seen by all processors.
index in the array
The new value for this instance.
Atomic int value. Operations exposed on this class are performed using System.Threading.Interlocked class and are
thread safe.
For AtomicInt values that are stored in arrays PaddedAtomicInt is recommended.
The AtomicInteger is a struct not a class and members of this type should *not* be declared readonly or changes
will not be reflected in the member instance.
The size in bytes occupied by an instance of this type
Initializes a new instance of the struct.
Initial value of the instance.
Add to this instance and return the resulting value.
The amount to add.
The value of this instance + the amount added.
Replace the value of this instance, if the current value is equal to the value.
Value this instance is expected to be equal with.
Value to set this instance to, if the current value is equal to the expected value
True if the update was made, false otherwise.
Decrement this instance and return the value after the decrement.
The value of the instance *after* the decrement.
Decrement this instance with and return the value after the decrement.
The value.
The value of the instance *after* the decrement.
Add to this instance and return the value this instance had before the add operation.
The amount to add.
The value of this instance before the amount was added.
Decrement this instance and return the value the instance had before the decrement.
The value of the instance *before* the decrement.
Decrement this instance with and return the value the instance had before the decrement.
The value.
The value of the instance *before* the decrement.
Increment this instance and return the value the instance had before the increment.
The value of the instance *before* the increment.
Increment this instance with and return the value the instance had before the increment.
The value.
The value of the instance *before* the increment.
Returns the current value of the instance and sets it to zero as an atomic operation.
The current value of the instance.
Returns the current value of the instance and sets it to as an atomic operation.
The new value.
The current value of the instance.
Returns the latest value of this instance written by any processor.
The latest written value of this instance.
Increment this instance and return the value after the increment.
The value of the instance *after* the increment.
Increment this instance with and return the value after the increment.
The value.
The value of the instance *after* the increment.
Returns the current value of the instance without using Volatile.Read fence and ordering.
The current value of the instance in a non-volatile way (might not observe changes on other threads).
Set the value without using Volatile.Write fence and ordering.
The new value for this instance.
Write a new value to this instance. The value is immediately seen by all processors.
The new value for this instance.
Decrements the specified value.
The value.
Atomic long value. Operations exposed on this class are performed using System.Threading.Interlocked class and are
thread safe.
For AtomicLong values that are stored in arrays PaddedAtomicLong is recommended.
The AtomicLong is a struct not a class and members of this type should *not* be declared readonly or changes will
not be reflected in the member instance.
The size in bytes occupied by an instance of this type
Initializes a new instance of the struct.
Initial value of the instance.
Add to this instance and return the resulting value.
The amount to add.
The value of this instance + the amount added.
Replace the value of this instance, if the current value is equal to the value.
Value this instance is expected to be equal with.
Value to set this instance to, if the current value is equal to the expected value
True if the update was made, false otherwise.
Decrement this instance and return the value after the decrement.
The value of the instance *after* the decrement.
Decrement this instance with and return the value after the decrement.
The value.
The value of the instance *after* the decrement.
Add to this instance and return the value this instance had before the add operation.
The amount to add.
The value of this instance before the amount was added.
Decrement this instance and return the value the instance had before the decrement.
The value of the instance *before* the decrement.
Decrement this instance with and return the value the instance had before the decrement.
The value.
The value of the instance *before* the decrement.
Increment this instance and return the value the instance had before the increment.
The value of the instance *before* the increment.
Increment this instance with and return the value the instance had before the increment.
The value.
The value of the instance *before* the increment.
Returns the current value of the instance and sets it to zero as an atomic operation.
The current value of the instance.
Returns the current value of the instance and sets it to as an atomic operation.
The new value.
The current value of the instance.
Returns the latest value of this instance written by any processor.
The latest written value of this instance.
Increment this instance and return the value after the increment.
The value of the instance *after* the increment.
Increment this instance with and return the value after the increment.
The value.
The value of the instance *after* the increment.
Returns the current value of the instance without using Volatile.Read fence and ordering.
The current value of the instance in a non-volatile way (might not observe changes on other threads).
Set the value without using Volatile.Write fence and ordering.
The new value for this instance.
Write a new value to this instance. The value is immediately seen by all processors.
The new value for this instance.
Adds the specified value.
The value.
Array of longs which provides atomic operations on the array elements.
Gets the length of the underlying array
The length.
Returns the size in bytes occupied by an AtomicLongArray instance.
instance for whch to calculate the size.
The size of the instance in bytes.
Add to this instance and return the resulting value.
index in the array
The amount to add.
The value of this instance + the amount added.
Replace the value of this instance, if the current value is equal to the value.
index in the array
Value this instance is expected to be equal with.
Value to set this instance to, if the current value is equal to the expected value
True if the update was made, false otherwise.
Decrement this instance and return the value after the decrement.
index in the array
The value of the instance *after* the decrement.
Decrement this instance with and return the value after the decrement.
index in the array
value to decrement with
The value of the instance *after* the decrement.
Add to this instance and return the value this instance had before the add operation.
index in the array
The amount to add.
The value of this instance before the amount was added.
Decrement this instance and return the value the instance had before the decrement.
index in the array
The value of the instance *before* the decrement.
Decrement this instance with and return the value the instance had before the decrement.
index in the array
value to decrement with
The value of the instance *before* the decrement.
Increment this instance and return the value the instance had before the increment.
index in the array
The value of the instance *before* the increment.
Increment this instance with and return the value the instance had before the increment.
index in the array
value to increment with
The value of the instance *before* the increment.
Returns the current value of the instance and sets it to zero as an atomic operation.
index in the array
The current value of the instance.
Returns the current value of the instance and sets it to as an atomic operation.
index in the array
value that will be set in the array at
The current value of the instance.
Returns the latest value of this instance written by any processor.
index in the array
The latest written value of this instance.
Increment this instance and return the value after the increment.
index in the array
The value of the instance *after* the increment.
Increment this instance with and return the value after the increment.
index in the array
value to increment with
The value of the instance *after* the increment.
Returns the current value of the instance without using Volatile.Read fence and ordering.
index in the array
The current value of the instance in a non-volatile way (might not observe changes on other threads).
Set the value without using Volatile.Write fence and ordering.
index in the array
The new value for this instance.
Write a new value to this instance. The value is immediately seen by all processors.
index in the array
The new value for this instance.
Padded version of the AtomicLong to avoid false CPU cache sharing. Recommended for cases where instances of
AtomicLong end up close to each other in memory - when stored in an array for eg.
An AtomicLong with heuristic padding to lessen cache effects of this heavily CAS'ed location. While the padding
adds noticeable space, the improved throughput outweighs using extra space
Initializes a new instance of the struct.
The value.
Add to this instance and return the resulting value.
The amount to add.
The value of this instance + the amount added.
Replace the value of this instance, if the current value is equal to the value.
Value this instance is expected to be equal with.
Value to set this instance to, if the current value is equal to the expected value
True if the update was made, false otherwise.
Decrement this instance and return the value after the decrement.
The value of the instance *after* the decrement.
Decrement this instance with and return the value after the decrement.
The value.
The value of the instance *after* the decrement.
Add to this instance and return the value this instance had before the add operation.
The amount to add.
The value of this instance before the amount was added.
Decrement this instance and return the value the instance had before the decrement.
The value of the instance *before* the decrement.
Decrement this instance with and return the value the instance had before the decrement.
The value.
The value of the instance *before* the decrement.
Increment this instance and return the value the instance had before the increment.
The value of the instance *before* the increment.
Increment this instance with and return the value the instance had before the increment.
The value.
The value of the instance *before* the increment.
Returns the current value of the instance and sets it to zero as an atomic operation.
The current value of the instance.
Returns the current value of the instance and sets it to as an atomic operation.
The new value.
The current value of the instance.
Returns the latest value of this instance written by any processor.
The latest written value of this instance.
Increment this instance and return the value after the increment.
The value of the instance *after* the increment.
Increment this instance with and return the value after the increment.
The value.
The value of the instance *after* the increment.
Returns the current value of the instance without using Volatile.Read fence and ordering.
The current value of the instance in a non-volatile way (might not observe changes on other threads).
Set the value without using Volatile.Write fence and ordering.
The new value for this instance.
Write a new value to this instance. The value is immediately seen by all processors.
The new value for this instance.
Decrements this instance.
Decrements the specified value.
The value.
Gets the and reset.
The value.
Gets the value.
The value
Increments this instance.
Increments the specified value.
The value.
Resets this instance.
A class holding common representation and mechanics for classes supporting dynamic striping on 64bit values.
Returns the size in bytes occupied by an Striped64 instance.
instance for whch to calculate the size.
The size of the instance in bytes.
One or more variables that together maintain an initially zero sum.
When updates are contended cross threads, the set of variables may grow dynamically to reduce contention.
Method GetValue() returns the current total combined across the variables maintaining the sum.
This class is usually preferable to AtomicLong when multiple threads update a common sum that is used for purposes
such as collecting statistics, not for fine-grained synchronization control.
Under low update contention, the two classes have similar characteristics.
But under high contention, expected throughput of this class is significantly higher, at the expense of higher
space consumption.
Initializes a new instance of the class.
Initializes a new instance of the class.
The initial value of the instance.
Creates a new instance of the adder with initial .
Returns the size in bytes occupied by an Striped64 instance.
instance for whch to calculate the size.
The size of the instance in bytes.
Add to this instance.
Value to add.
Decrement the value of this instance.
Decrement the value of this instance with .
The value.
Returns the current value of this adder and resets the value to zero.
This method sums all the buckets, resets their value and returns the result.
This method is thread-safe. If updates happen during this method, they are either included in the final sum, or
reflected in the value after the reset.
The current value recored by this adder.
Returns the current value of this adder. This method sums all the buckets and returns the result.
The current value recored by this adder.
Increment the value of this instance.
Increment the value of this instance with .
The value.
Returns the current value of the instance without using Volatile.Read fence and ordering.
The current value of the instance in a non-volatile way (might not observe changes on other threads).
Resets the current value to zero.
This class is similar in functionality with the StripedLongAdder, but uses the ThreadLocal class to
keep a value for each thread. The GetValue method sums all the values and returns the result.
This class is a bit faster (in micro-benchmarks) than the StripedLongAdder for incrementing a value on multiple
threads, but it creates a ValueHolder instance for each thread that increments the value, not just for when
contention is
present. Considering this, the StripedLongAdder might be a better solution in some cases (multiple threads,
relatively low
contention).
We store a ValueHolder instance for each thread that requires one.
Initializes a new instance of the class.
Creates a new instance of the adder with initial value of zero.
Initializes a new instance of the class.
The initial value of the instance.
Creates a new instance of the adder with initial .
Returns the size in bytes occupied by an ThreadLocalAddre instance.
instance for whch to calculate the size.
The size of the instance in bytes.
Add to this instance.
Value to add.
Decrement the value of this instance.
Decrement the value of this instance with .
The value.
Returns the current value of this adder and resets the value to zero.
This method sums all the thread local variables, resets their value and returns the result.
This method is thread-safe. If updates happen during this method, they are either included in the final sum, or
reflected in the value after the reset.
The current value recored by this adder.
Returns the current value of this adder. This method sums all the thread local variables and returns the result.
The current value recored by this adder.
Increment the value of this instance.
Increment the value of this instance with .
The value.
Returns the current value of the instance without using Volatile.Read fence and ordering.
The current value of the instance in a non-volatile way (might not observe changes on other threads).
Resets the current value to zero.
Helper class to generate Random values is a thread safe way. Not suitable for cryptographic operations.
Double value on which the GetValue/SetValue operations are performed using Volatile.Read/Volatile.Write.
This datastructure is a struct. If a member is declared readonly VolatileDouble calling set will *NOT* modify the
value.
GetValue/SetValue are expressed as methods to make it obvious that a non-trivial operation is performed.
The size in bytes occupied by an instance of this type
Initializes a new instance of the struct.
Initial value of the instance.
Initialize the value of this instance
Get the current value of this instance
The current value of the instance
Returns the current value of the instance without using Volatile.Read fence and ordering.
The current value of the instance in a non-volatile way (might not observe changes on other threads).
Set the value without using Volatile.Write fence and ordering.
The new value for this instance.
Set the the value of this instance to
Don't call Set on readonly fields.
New value for this instance