-
Notifications
You must be signed in to change notification settings - Fork 2
Queue Type
By setting the QueueType, you can determine whether the thread pool will operate in a first-in-first-out (FIFO) or last-in-first-out (LIFO) manner to meet various business requirements.
Default is FIFO.
powerPool.PowerPoolOption = new PowerPoolOption()
{
QueueType = QueueType.LIFO,
};
If PowerPoolOption.CustomQueueFactory is set, regardless of whether QueueType is set or not, PowerThreadPool will use instances of the custom queue type to manage work items.
The custom queue type must inherit from the IStealablePriorityCollection<string>
interface, which includes three methods.
Sets an item with a specified priority in the collection.
void Set(T item, int priority);
Retrieves and removes the highest priority item from the collection.
The method is typically called by the owner thread to fetch the next work.
T Get();
Steals and removes the lowest priority item from the collection.
This method is typically called by other threads to steal work from the owner thread.
T Steal();
- Pool Control | Work Control
- Thread Pool Sizing
- Work Callback | Default Callback
- Parallel Execution
- Work Priority | Thread Priority
- Error Handling
- Work Timeout | Cumulative Work Timeout
- Work Dependency
- Work Group
- Events
- Runtime Status
- Queue Type (FIFO | LIFO | Custom)
- Load Balancing
- Lock-Free
Core
Results
Options