Skip to content

Remove MinHandles and OutstandingHandles logic from SocketAsyncEngine#36019

Merged
adamsitnik merged 5 commits intodotnet:masterfrom
adamsitnik:removeMinHandles
May 8, 2020
Merged

Remove MinHandles and OutstandingHandles logic from SocketAsyncEngine#36019
adamsitnik merged 5 commits intodotnet:masterfrom
adamsitnik:removeMinHandles

Conversation

@adamsitnik
Copy link
Member

@tmds here is the promised removal of MinHandles logic. I am going to run some benchmarks for it tomorrow.

@adamsitnik adamsitnik added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label May 7, 2020
@ghost
Copy link

ghost commented May 7, 2020

Tagging subscribers to this area: @dotnet/ncl
Notify danmosemsft if you want to be subscribed.

_nextHandle = IntPtr.Add(_nextHandle, 1);
_outstandingHandles = IntPtr.Add(_outstandingHandles, 1);

Debug.Assert(handle != ShutdownHandle, $"Expected handle != ShutdownHandle: {handle}");
Copy link
Member Author

Choose a reason for hiding this comment

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

this is checked before adding to dictionary

@adamsitnik adamsitnik changed the title Remove MinHandles logic from SocketAsyncEngine Remove MinHandles and OutstandingHandles logic from SocketAsyncEngine May 8, 2020
@adamsitnik adamsitnik removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label May 8, 2020
@adamsitnik adamsitnik marked this pull request as ready for review May 8, 2020 08:29
@adamsitnik adamsitnik requested review from stephentoub and tmds May 8, 2020 08:29
@adamsitnik
Copy link
Member Author

I just confirmed that there are no regressions, the PR is ready for review

@adamsitnik adamsitnik requested a review from antonfirsov May 8, 2020 10:58
@tmds
Copy link
Member

tmds commented May 8, 2020

Thanks for cleaning this up.

{
s_currentEngines[s_allocateFromEngine] = engine = new SocketAsyncEngine();
}
s_currentEngines[s_allocateFromEngine] = engine = new SocketAsyncEngine();
Copy link
Member

Choose a reason for hiding this comment

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

FWIW, the above can be condensed to:

engine = s_currentEngines[s_allocateFromEngine] ??= new SocketAsyncEngine();

Copy link
Member

Choose a reason for hiding this comment

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

Nit: pre-existing your code, but the current in s_currentEngines seems superfluous. Maybe just s_engines.

@adamsitnik adamsitnik merged commit 2e1bc9d into dotnet:master May 8, 2020
@adamsitnik adamsitnik deleted the removeMinHandles branch May 8, 2020 14:28
@karelz karelz added this to the 5.0.0 milestone Aug 18, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
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.

5 participants