From 8da0d04af1b2621b0e6c33f9a4886754794f02c5 Mon Sep 17 00:00:00 2001 From: David Pine Date: Wed, 8 Jun 2022 10:54:11 -0500 Subject: [PATCH] Added cautionary alert to address concerns in #29010 --- .../exception-handling-task-parallel-library.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/standard/parallel-programming/exception-handling-task-parallel-library.md b/docs/standard/parallel-programming/exception-handling-task-parallel-library.md index 0c48439553e72..5ad0122830ec1 100644 --- a/docs/standard/parallel-programming/exception-handling-task-parallel-library.md +++ b/docs/standard/parallel-programming/exception-handling-task-parallel-library.md @@ -1,7 +1,7 @@ --- title: "Exception handling (Task Parallel Library)" description: Explore exception handling using the Task Parallel Library (TPL) in .NET. See nested aggregate exceptions, inner exceptions, unobserved task exceptions, & more. -ms.date: 05/06/2022 +ms.date: 06/08/2022 dev_langs: - "csharp" - "vb" @@ -27,6 +27,9 @@ If you do not want to call the [!CAUTION] +> The preceding example code includes a `while` loop that polls the task's property to determine when the task has completed. This should never be done in production code as it is very inefficient. + If you do not wait on a task that propagates an exception, or access its property, the exception is escalated according to the .NET exception policy when the task is garbage-collected. When exceptions are allowed to bubble up back to the joining thread, it is possible that a task may continue to process some items after the exception is raised.