Clarify SemaphoreSlim "very short" wait time guidance#52288
Clarify SemaphoreSlim "very short" wait time guidance#52288
Conversation
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
BillWagner
left a comment
There was a problem hiding this comment.
The actual fix here is somewhat misleading. I've added a specific comment for you to address.
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
Addressed in commit 1fd6149. The description of "short" now correctly explains that the appropriate duration is context-dependent—determined by whether the wait is for CPU resources or non-CPU-bound resources—rather than giving a potentially misleading fixed time value. |
BillWagner
left a comment
There was a problem hiding this comment.
Once I make one final change, this is ready.
There was a problem hiding this comment.
Pull request overview
This PR refreshes the conceptual documentation for Semaphore and SemaphoreSlim, updating the page metadata and rewriting the introductory guidance to better explain intended usage patterns.
Changes:
- Updates the article’s
ms.dateand addsai-usage: ai-assistedfrontmatter. - Rewrites the main content for clarity and modern style (including additional guidance on
SemaphoreSlimspinning behavior). - Rewords the named semaphore guidance and associated note.
BillWagner
left a comment
There was a problem hiding this comment.
@copilot please address this review comment.
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
The
SemaphoreSlimdocs used "very short wait times" with no definition, leaving readers to guess what that means and what happens when waits exceed that threshold.Changes
Semaphore(which doesn't spin) when wait times are unpredictable or expected to be significantms.date, addedai-usage: ai-assistedOriginal prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.
Internal previews