-
Notifications
You must be signed in to change notification settings - Fork 16
Work Dependency
If WorkOption.Dependents is set, the work will not start until all dependent works have completed execution.
WorkID id0 = powerPool.QueueWorkItem(() =>
{
//Do something
});
WorkID id1 = powerPool.QueueWorkItem(() =>
{
//Do something
});
powerPool.QueueWorkItem(() =>
{
//Do something
},
new WorkOption()
{
Dependents = new ConcurrentSet<WorkID>() { id0, id1 }
});The thread pool will only save the information of works that have failed, and the record of failed works will be cleared when the thread pool enters the Idle state and is restarted, unless the PowerPoolOption.ClearFailedWorkRecordWhenPoolStart is set to false.
Normally, if a work begins execution but the work it depends on fail to complete, then it should not be allowed to execute.
If PowerPoolOption.ClearFailedWorkRecordWhenPoolStart is true, to prevent the loss of failure informations leading to the thread pool erroneously allowing the work to start, one can use PowerPool.EnablePoolIdleCheck to temporarily halt the thread pool's idle check until this work has been added to the thread pool.
If a circular dependency is detected when submitting the task, a CycleDetectedException will be thrown.
- 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