Class ThreadPoolUtility
Provide ways to work more efficient with System.Threading.Tasks.TaskFactory.StartNew(Action) related tasks.
Inheritance
Namespace: Cuemon.Threading
Assembly: Cuemon.Threading.dll
Syntax
public static class ThreadPoolUtility
Methods
| Improve this DocQueueWork(Action)
Queues the specified method
for execution. The method
executes when a thread pool thread becomes available.
Declaration
public static void QueueWork(Action method)
Parameters
Type | Name | Description |
---|---|---|
System.Action | method | The delegate that is being invoked when a thread pool thread becomes available. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
QueueWork<T>(Action<T>, T)
Queues the specified method
for execution. The method
executes when a thread pool thread becomes available.
Declaration
public static void QueueWork<T>(Action<T> method, T arg)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | method | The delegate that is being invoked when a thread pool thread becomes available. |
T | arg | The parameter of the delegate |
Type Parameters
Name | Description |
---|---|
T | The type of the parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
QueueWork<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
Queues the specified method
for execution. The method
executes when a thread pool thread becomes available.
Declaration
public static void QueueWork<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> | method | The delegate that is being invoked when a thread pool thread becomes available. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
T5 | arg5 | The fifth parameter of the delegate |
T6 | arg6 | The sixth parameter of the delegate |
T7 | arg7 | The seventh parameter of the delegate |
T8 | arg8 | The eighth parameter of the delegate |
T9 | arg9 | The ninth parameter of the delegate |
T10 | arg10 | The tenth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
T5 | The type of the fifth parameter of the delegate |
T6 | The type of the sixth parameter of the delegate |
T7 | The type of the seventh parameter of the delegate |
T8 | The type of the eighth parameter of the delegate |
T9 | The type of the ninth parameter of the delegate |
T10 | The type of the tenth parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
QueueWork<T1, T2>(Action<T1, T2>, T1, T2)
Queues the specified method
for execution. The method
executes when a thread pool thread becomes available.
Declaration
public static void QueueWork<T1, T2>(Action<T1, T2> method, T1 arg1, T2 arg2)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2> | method | The delegate that is being invoked when a thread pool thread becomes available. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
QueueWork<T1, T2, T3>(Action<T1, T2, T3>, T1, T2, T3)
Queues the specified method
for execution. The method
executes when a thread pool thread becomes available.
Declaration
public static void QueueWork<T1, T2, T3>(Action<T1, T2, T3> method, T1 arg1, T2 arg2, T3 arg3)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3> | method | The delegate that is being invoked when a thread pool thread becomes available. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
QueueWork<T1, T2, T3, T4>(Action<T1, T2, T3, T4>, T1, T2, T3, T4)
Queues the specified method
for execution. The method
executes when a thread pool thread becomes available.
Declaration
public static void QueueWork<T1, T2, T3, T4>(Action<T1, T2, T3, T4> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4> | method | The delegate that is being invoked when a thread pool thread becomes available. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
QueueWork<T1, T2, T3, T4, T5>(Action<T1, T2, T3, T4, T5>, T1, T2, T3, T4, T5)
Queues the specified method
for execution. The method
executes when a thread pool thread becomes available.
Declaration
public static void QueueWork<T1, T2, T3, T4, T5>(Action<T1, T2, T3, T4, T5> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5> | method | The delegate that is being invoked when a thread pool thread becomes available. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
T5 | arg5 | The fifth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
T5 | The type of the fifth parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
QueueWork<T1, T2, T3, T4, T5, T6>(Action<T1, T2, T3, T4, T5, T6>, T1, T2, T3, T4, T5, T6)
Queues the specified method
for execution. The method
executes when a thread pool thread becomes available.
Declaration
public static void QueueWork<T1, T2, T3, T4, T5, T6>(Action<T1, T2, T3, T4, T5, T6> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6> | method | The delegate that is being invoked when a thread pool thread becomes available. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
T5 | arg5 | The fifth parameter of the delegate |
T6 | arg6 | The sixth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
T5 | The type of the fifth parameter of the delegate |
T6 | The type of the sixth parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
QueueWork<T1, T2, T3, T4, T5, T6, T7>(Action<T1, T2, T3, T4, T5, T6, T7>, T1, T2, T3, T4, T5, T6, T7)
Queues the specified method
for execution. The method
executes when a thread pool thread becomes available.
Declaration
public static void QueueWork<T1, T2, T3, T4, T5, T6, T7>(Action<T1, T2, T3, T4, T5, T6, T7> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6, T7> | method | The delegate that is being invoked when a thread pool thread becomes available. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
T5 | arg5 | The fifth parameter of the delegate |
T6 | arg6 | The sixth parameter of the delegate |
T7 | arg7 | The seventh parameter of the delegate |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
T5 | The type of the fifth parameter of the delegate |
T6 | The type of the sixth parameter of the delegate |
T7 | The type of the seventh parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
QueueWork<T1, T2, T3, T4, T5, T6, T7, T8>(Action<T1, T2, T3, T4, T5, T6, T7, T8>, T1, T2, T3, T4, T5, T6, T7, T8)
Queues the specified method
for execution. The method
executes when a thread pool thread becomes available.
Declaration
public static void QueueWork<T1, T2, T3, T4, T5, T6, T7, T8>(Action<T1, T2, T3, T4, T5, T6, T7, T8> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6, T7, T8> | method | The delegate that is being invoked when a thread pool thread becomes available. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
T5 | arg5 | The fifth parameter of the delegate |
T6 | arg6 | The sixth parameter of the delegate |
T7 | arg7 | The seventh parameter of the delegate |
T8 | arg8 | The eighth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
T5 | The type of the fifth parameter of the delegate |
T6 | The type of the sixth parameter of the delegate |
T7 | The type of the seventh parameter of the delegate |
T8 | The type of the eighth parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
QueueWork<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>, T1, T2, T3, T4, T5, T6, T7, T8, T9)
Queues the specified method
for execution. The method
executes when a thread pool thread becomes available.
Declaration
public static void QueueWork<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9> | method | The delegate that is being invoked when a thread pool thread becomes available. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
T5 | arg5 | The fifth parameter of the delegate |
T6 | arg6 | The sixth parameter of the delegate |
T7 | arg7 | The seventh parameter of the delegate |
T8 | arg8 | The eighth parameter of the delegate |
T9 | arg9 | The ninth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
T5 | The type of the fifth parameter of the delegate |
T6 | The type of the sixth parameter of the delegate |
T7 | The type of the seventh parameter of the delegate |
T8 | The type of the eighth parameter of the delegate |
T9 | The type of the ninth parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|