-
Notifications
You must be signed in to change notification settings - Fork 6
Timeout
ZjzMisaka edited this page Sep 8, 2023
·
1 revision
PowerPoolOption.Timeout: Represents the maximum amount of time that all works in a thread pool can run collectively before they are terminated. It includes a duration in milliseconds (ms) and a boolean flag for forcefully stopping the work.
PowerPoolOption.DefaultWorkTimeout: Represents the default maximum amount of time a work in the pool can run before it is terminated. It includes a duration in milliseconds (ms) and a boolean flag for forcefully stopping the work.
PowerPool powerPool = new PowerPool();
powerPool.PowerPoolOption = new PowerPoolOption()
{
Timeout = new TimeoutOption() { Duration = 10000, ForceStop = false },
DefaultWorkTimeout = new TimeoutOption() { Duration = 3000, ForceStop = false },
};
WorkOption.Timeout: Represents the maximum amount of time a specific work can run before it is terminated. It includes a duration in milliseconds (ms) and a boolean flag for forcefully stopping the work.
powerPool.QueueWorkItem(() =>
{
// Do something
}, new WorkOption()
{
Timeout = new TimeoutOption() { Duration = 2000, ForceStop = true }
});
- 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
- Running Timer
- Queue Type (FIFO | LIFO | Custom)
- Load Balancing
- Lock-Free
Core
Results
Options