Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Avoid unnecessarily propagating ExecutionContext in SocketAsyncEngine #28676

Merged
merged 1 commit into from
Mar 31, 2018

Conversation

stephentoub
Copy link
Member

SocketAsyncEngines are created lazily on-demand. If we happen to create one at a point where there's a non-default ExecutionContext, we end up capturing that context onto the event loop thread, such that all subsequent dispatches capture and restore that ExecutionContext.

Fixes https://github.com/dotnet/corefx/issues/28482
cc: @benaadams, @geoffkizer, @tmds

SocketAsyncEngines are created lazily on-demand.  If we happen to create one at a point where there's a non-default ExecutionContext, we end up capturing that context onto the event loop thread, such that all subsequent dispatches capture and restore that ExecutionContext.
@stephentoub stephentoub added this to the 2.1.0 milestone Mar 31, 2018
@geoffkizer
Copy link

LGTM

@stephentoub stephentoub merged commit ec5fb41 into dotnet:master Mar 31, 2018
@stephentoub stephentoub deleted the unixec branch March 31, 2018 13:14
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…dotnet/corefx#28676)

SocketAsyncEngines are created lazily on-demand.  If we happen to create one at a point where there's a non-default ExecutionContext, we end up capturing that context onto the event loop thread, such that all subsequent dispatches capture and restore that ExecutionContext.

Commit migrated from dotnet/corefx@ec5fb41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants