You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So the Parallel class looks at the CancellationToken [from time to time, that's not specified] to prematurely end the loop. But what happens if the OperationCanceledException was already thrown from within the code executed in parallel, using the same CancellationToken? Will it be caught and handled properly? Or will it be passed on in some form of AggregateException just like any other exception being thrown in Parallel loops? Multiple concurrently running "tasks" might throw that exception at the same time before the loop can end. Some clarification on how I may use the CancellationToken would be helpful.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: 7620a94b-fde4-4d61-904d-3ff319427c38
Version Independent ID: c8805d8a-332c-ad1a-1e8d-dd10daf1b59e
So the Parallel class looks at the CancellationToken [from time to time, that's not specified] to prematurely end the loop. But what happens if the OperationCanceledException was already thrown from within the code executed in parallel, using the same CancellationToken? Will it be caught and handled properly? Or will it be passed on in some form of AggregateException just like any other exception being thrown in Parallel loops? Multiple concurrently running "tasks" might throw that exception at the same time before the loop can end. Some clarification on how I may use the CancellationToken would be helpful.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: