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

AwaitableSocketAsyncEventArgs should use UnsafeQueueUserWorkItem #33685

Closed

Conversation

benaadams
Copy link
Member

Might even be non-allocating if... dotnet/coreclr#21159 😉

/cc @stephentoub @davidfowl

@benaadams
Copy link
Member Author

Needs #33637 first

@stephentoub
Copy link
Member

stephentoub commented Nov 25, 2018

Might even be non-allocating if

It basically already is. This path is only used if the operation completes asynchronously in the small window after we check IsCompleted but before we call UnsafeOnCompleted. Are you actually seeing non-trivial numbers of allocations there in traces?

@stephentoub
Copy link
Member

Thanks, but as it stands this isn't a valid change. In the only path where this is used (noted above), we may actually need to flow ExecutionContext, e.g. socket.ReceiveAsync(...).GetAwaiter().OnCompleted(...).

@benaadams
Copy link
Member Author

I missed the forceAsync: false on the other caller

@karelz karelz added this to the 3.0 milestone Dec 21, 2018
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.

4 participants