-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Revised ManualResetEvent remarks #1739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
rpetrusha
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @pkulikov. This is a substantial improvement of the ManualResetEvents documentation. I've left some suggested changes, as well as a request for a change unrelated to your PR.
| ## Remarks | ||
| You can use this class for better performance than <xref:System.Threading.ManualResetEvent> when wait times are expected to be very short, and when the event does not cross a process boundary. <xref:System.Threading.ManualResetEventSlim> uses busy spinning for a short time while it waits for the event to become signaled. When wait times are short, spinning can be much less expensive than waiting by using wait handles. However, if the event does not become signaled within a certain period of time, <xref:System.Threading.ManualResetEventSlim> resorts to a regular event handle wait. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to your PR: The type description, "Provides a slimmed down version of ManualResetEvent", isn't helpful. Could you expand it by adding "to represent a thread synchronization event that, when signaled, must be reset manually."?
Co-Authored-By: pkulikov <[email protected]>
|
@rpetrusha thank you for review and suggestions. I've addressed all the feedback (also replaced the "slimmed down" words with "lightweight", as it looks to be more common in the docs so far). |
|
Thanks for the additional changes, @pkulikov. And "lightweight" is vastly superior to "slimmed down". I'll merge your PR now. |
Accompanies dotnet/docs#10233
/cc: @rpetrusha