-
Notifications
You must be signed in to change notification settings - Fork 16
Home
ZjzMisaka edited this page Mar 1, 2024
·
42 revisions

Provides a comprehensive and efficient thread pool implementation, allowing for granular work control, dependencies, customizable concurrency, events, priority handling, timeout options, callbacks, error handling, and load balancing, alongside an easy-to-use API for diverse task submissions.
PowerThreadPool is available as Nuget Package now.
Support: Net46+ | Net5.0+
- Pool Control | Work Control
- Work Dependency
- Thread Pool Sizing
- Work Priority | Thread Priority
- Work Timeout | Cumulative Work Timeout
- Work Callback | Default Callback
- Error Handling
- Runtime Status
- Load Balancing
PowerPool powerPool = new PowerPool(new PowerPoolOption() { /* Some options */ });
powerPool.QueueWorkItem(() =>
{
// DO SOMETHING
});PowerPool powerPool = new PowerPool(new PowerPoolOption() { /* Some options */ });
powerPool.QueueWorkItem(() =>
{
// DO SOMETHING
return result;
}, (res) =>
{
// Callback of the work
});PowerPool powerPool = new PowerPool(new PowerPoolOption() { /* Some options */ });
powerPool.QueueWorkItem(() =>
{
// DO SOMETHING
return result;
}, new WorkOption()
{
// Some options
});string QueueWorkItem(Action action, *);
string QueueWorkItem(Action<object[]> action, object[] param, *);
string QueueWorkItem<T1, ...>(Action<T1, ...> action, T1 param1, ..., *);
string QueueWorkItem<T1, ..., TResult>(Func<T1, ..., TResult> function, T1 param1, ..., *);
string QueueWorkItem<TResult>(Func<TResult> function, *);
string QueueWorkItem<TResult>(Func<object[], TResult> function, object[] param, *);- Asterisk (*) denotes an optional parameter, either a WorkOption or a delegate (Action<ExecuteResult<object>> or Action<ExecuteResult<TResult>>), depending on whether the first parameter is an Action or a Func.
- In places where you see ellipses (...), you can provide up to five generic type parameters.
- Sync | Async
- Pool Control | Work Control
- Divide And Conquer
- Thread Pool Sizing
- Work Callback | Default Callback
- Rejection Policy
- Parallel Execution
- Work Priority | Thread Priority
- Error Handling
- Work Timeout | Cumulative Work Timeout
- Work Dependency
- Work Group
- Events
- Runtime Status
- Running Timer
- Queue Type (FIFO | LIFO | Custom | Deque)
- Load Balancing
- Low-Contention Design
Core
Results
Options