Skip to content

Commit 84ec823

Browse files
committed
C#: Add some explanatory comments about parallel restore.
1 parent 0127b77 commit 84ec823

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DependencyManager.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,9 @@ private bool RestoreSolution(string solution, out IEnumerable<string> projects)
360360

361361
/// <summary>
362362
/// Executes `dotnet restore` on all solution files in solutions.
363+
/// As opposed to RestoreProjects this is not run in parallel using PLINQ
364+
/// as `dotnet restore` on a solution already uses multiple threads for restoring
365+
/// the projects (this can be disabled with the `--disable-parallel` flag).
363366
/// Returns a list of projects that are up to date with respect to restore.
364367
/// </summary>
365368
/// <param name="solutions">A list of paths to solution files.</param>
@@ -370,6 +373,13 @@ private IEnumerable<string> RestoreSolutions(IEnumerable<string> solutions) =>
370373
return restoredProjects;
371374
});
372375

376+
/// <summary>
377+
/// Executes `dotnet restore` on all projects in projects.
378+
/// This is done in parallel for performance reasons.
379+
/// To ensure that output is not interleaved, the output of each
380+
/// restore is collected and printed.
381+
/// </summary>
382+
/// <param name="projects">A list of paths to project files.</param>
373383
private void RestoreProjects(IEnumerable<string> projects)
374384
{
375385
var stdoutLines = projects

0 commit comments

Comments
 (0)