I have read this method's documentation but it is fairly light on details.
Enable concurrent execution of analyzer actions registered by this analyzer.
What exactly is executed concurrently? Say I have:
public override void Initialize(AnalysisContext context)
{
context.EnableConcurrentExecution();
context.RegisterSyntaxNodeAction(AnalyzeNode, SyntaxKind.InvocationExpression);
}
If the code under analysis contains multiple InvocationExpressions, will each expression be concurrently analyzed on its own thread?
However, such an analyzer must ensure that its actions can execute correctly in parallel.
What constitutes an "action", and how do I ensure it executes "correctly"? My AnalyzeNode method is static, reads from immutable state, and does not write to any shared state. Is this enough?
Are there any drawbacks to enabling concurrent execution?
Or am I misunderstanding this entirely?