Skip to content
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

[wasm][mt] Improve blocking wait detection and tests #98045

Conversation

radekdoulik
Copy link
Member

Add check to the SemaphoreSlim.Wait. The wait will eventually continue to the Monitor.Wait, it can spin wait first though and return, so catch it earlier to avoid non-deterministic behavior.

Improve the blocking wait detection and extract it to the new method. Also introduce a helper method to force a blocking wait in places we want it happen on the JS interop threads too.

Add check to the `SemaphoreSlim.Wait`. The wait will eventually continue
to the `Monitor.Wait`, it can spin wait first though and return, so catch
it earlier to avoid non-deterministic behavior.

Improve the blocking wait detection and extract it to the new method. Also
introduce helper method to force a blocking wait in places we want it
on the JS interop threads.
@dotnet-issue-labeler dotnet-issue-labeler bot added needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners new-api-needs-documentation labels Feb 6, 2024
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost ghost assigned radekdoulik Feb 6, 2024
@radekdoulik radekdoulik added area-VM-threading-mono and removed new-api-needs-documentation needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Feb 6, 2024
@radekdoulik radekdoulik modified the milestones: 8.0.x, 9.0.0 Feb 6, 2024
@radekdoulik
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@radekdoulik
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@pavelsavara pavelsavara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I like it!

@radekdoulik radekdoulik merged commit 59831ac into dotnet:main Feb 7, 2024
196 of 206 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants