Skip to content

Commit b2aa5b2

Browse files
committed
Elaborate on avoiding complex operations
1 parent 8c7eb9c commit b2aa5b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/core/diagnostics/eventsource-collect-and-view-traces.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,6 @@ this isn't required. Following is an example `EventListener` implementation that
280280
>
281281
> To mitigate this risk, consider the following precautions:
282282
>
283-
> - **Avoid Complex Operations**: Refrain from performing complex operations within the callback that might acquire additional locks.
283+
> - **Avoid Complex Operations**: Refrain from performing complex operations within the callback that might acquire additional locks. For example, during some event callbacks, attempting to use File or Console APIs may encounter issues. Instead, you can update an in-memory datastructure or add some information about the event to a queue. If more processing is needed it can be done from a separate thread after the callback has already returned.
284284
> - **Minimize Lock Duration**: Ensure that any locks acquired within the callback are not held for extended periods.
285285
> - **Use Non-blocking APIs**: Prefer using non-blocking APIs within the callback to avoid potential deadlocks.

0 commit comments

Comments
 (0)