Is the task of the parallel library to block operations?
How does the .NET Task parallel library work with blocking tasks? In the C ++ Concrt library, you have a method Context::Oversubscribe
, but I haven't found one in the .NET library? Is the parameter the LongRunningTask
appropriate way to handle blocking tasks?
.ie: in C ++ you would do:
auto my_task_func = []
{
//Do work...
Context::Oversubscribe(true);
// Short or long blocking op.
Context::Oversubscribe(false);
//Do more work.
}
+3
source to share