Class SPMCQueue<T>
- Namespace
- Misaki.HighPerformance.Jobs
- Assembly
- Misaki.HighPerformance.Jobs.dll
public class SPMCQueue<T>
Type Parameters
T
- Inheritance
-
SPMCQueue<T>
- Inherited Members
Constructors
SPMCQueue(int)
Initializes a new instance of the SPMCQueue class with the specified capacity.
public SPMCQueue(int capacity)
Parameters
capacityintThe capacity of the queue.
Remarks
This queue will not resize when it reaches capacity.
Properties
IsEmpty
public bool IsEmpty { get; }
Property Value
Methods
TryPop(out T?)
Trys to pop an item from the queue.
public bool TryPop(out T? item)
Parameters
itemTThe item to pop.
Returns
- bool
True if an item was popped successfully; otherwise, false.
TryPush(T)
Tries to push an item onto the queue.
public bool TryPush(T item)
Parameters
itemTThe item to push.
Returns
- bool
True if the item was pushed successfully; otherwise, false.
TrySteal(out T?)
Trys to steal an item from the queue.
public bool TrySteal(out T? item)
Parameters
itemTThe item to steal.
Returns
- bool
True if an item was stolen successfully; otherwise, false.