Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Optimize Interlocked.CompareExchange use in Task #93953

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

pentp
Copy link
Contributor

@pentp pentp commented Oct 25, 2023

Always use Interlocked.CompareExchange result when possible instead of re-reading the value.
Use m_stateObject for storing WhenAllPromise failed/canceled tasks.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Oct 25, 2023
@ghost
Copy link

ghost commented Oct 25, 2023

Tagging subscribers to this area: @dotnet/area-system-threading-tasks
See info in area-owners.md if you want to be subscribed.

Issue Details

Always use Interlocked.CompareExchange result when possible instead of re-reading the value.
Use m_stateObject for storing WhenAllPromise failed/canceled tasks.

Author: pentp
Assignees: -
Labels:

area-System.Threading.Tasks, community-contribution

Milestone: -

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Thanks!

@tannergooding
Copy link
Member

@pentp, just wanted to make sure you had seen Stephen's comments. Are you planning on fixing those here in this PR or would you prefer to push up a second PR after this one is merged since they're relatively minor?

@stephentoub stephentoub merged commit 7e5e2e7 into dotnet:main Feb 21, 2024
174 of 178 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 2024
@pentp pentp deleted the task-interlocked branch May 6, 2024 09:16
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
area-System.Threading.Tasks community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants