Skip to content

Stop using native callbacks for C##1966

Merged
murgatroid99 merged 2 commits intogrpc:masterfrom
jtattermusch:csharp_revamp
Jun 9, 2015
Merged

Stop using native callbacks for C##1966
murgatroid99 merged 2 commits intogrpc:masterfrom
jtattermusch:csharp_revamp

Conversation

@jtattermusch
Copy link
Copy Markdown
Contributor

Reworks the way completion events are handled in C#.
Initially, calling completion_queue_next was invoking a native-to-managed callback. That worked but it had some unexpected performance overhead (especially under mono). Also it required some extra code to make sure that the delegates won't get deallocated before the native callback gets called (which would result in a crash).

The new approach utilizes the simplified layout of gprc_event and after completion_queue_next returns callback handler is retrieved from a concurrent dictionary. This should also simplify testing in the future because it is now easier to mock callback registry in tests.

murgatroid99 added a commit that referenced this pull request Jun 9, 2015
Stop using native callbacks for C#
@murgatroid99 murgatroid99 merged commit 02f9cb2 into grpc:master Jun 9, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants