Skip to content

Generate DkmEvaluationResults asynchronously - #986

Merged
cston merged 6 commits into
dotnet:masterfrom
cston:Async
Mar 4, 2015
Merged

Generate DkmEvaluationResults asynchronously#986
cston merged 6 commits into
dotnet:masterfrom
cston:Async

Conversation

@cston

@cston cston commented Mar 3, 2015

Copy link
Copy Markdown
Contributor

Generate subsequent DkmEvaluationResults asynchronously rather than in completion from previous DkmEvaluationResults to avoid stack overflow when many items are requested and evaluation is not already asynchronous (when EvaluateDebuggerDisplayString is not used).

@cston

cston commented Mar 3, 2015

Copy link
Copy Markdown
Contributor Author

@KevinH-MS, @amcasey, @pnelsonmsft

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As far as I can tell, there are three kinds of completion routines floating around, WorkListCompletionRoutine, CompletionRoutine, and DkmCompletionRoutine. However, we seem to call locals of all three types "completionRoutine". I think the code would be much easier to follow if we gave them distinct names.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've removed WorkListCompletionRoutine.

@amcasey

amcasey commented Mar 3, 2015

Copy link
Copy Markdown
Member

Consider splitting CompletionRoutine into

internal delegate void ExceptionCompletionRoutine(Exception exception);
internal delegate void SuccessCompletionRoutine(DkmEvaluationResult result);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like we could call wl.ContinueWith outside the lambda (e.g. immediately after construction).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The lambda passed to wl.ContinueWith must be the last continuation, after any added while executing GetEvaluationResultsAndContinue.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If this isn't part of the real type, can we add a doc comment?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Consider using => body for trivial properties.

@KevinH-MS

Copy link
Copy Markdown
Contributor

LGTM

cston added a commit that referenced this pull request Mar 4, 2015
Generate DkmEvaluationResults asynchronously

Generate subsequent DkmEvaluationResults asynchronously rather than in the completion from previous DkmEvaluationResults to avoid stack overflow when many items are requested and evaluation is not already asynchronous (when EvaluateDebuggerDisplayString is not used).
@cston
cston merged commit d09927b into dotnet:master Mar 4, 2015
@cston
cston deleted the Async branch March 4, 2015 02:08

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be "index < numRows"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

numRows - 1 since we're deciding whether to evaluate row index + 1.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would we get the same result if we changed it to "index < numRows" and removed the "else..."? That is, would the outer if catch it and call the completion routine when we call GetEvaluationResultsAndContinue with "index + 1"?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually, could we remove the if/else from the lambda entirely and just call GetEvaluationResultsAndContinue (relying on the outer if to call the completionRoutine)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants