dotnet / dotnet/msbuild

Re-evaluate Copy Task explicit Thread management for Multithreaded scenarios

Open
#13,954 0 comments 0 reactions 0 assignees Claimed by @jankratochvilcz View on GitHub
Area: Multithreaded Area: Tasks triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Summary

The Copy Task today manages a static pool of threads to do copies with (see [here](https://github.com/dotnet/msbuild/blob/main/src/Tasks/Copy.cs#L54-L74)). This could lead to contention in MT scenarios.

### Background and Motivation

See aboveIn multiprocess mode, this results in each worker node that runs the Copy task having a dedicated 4- or 6-thread pool for those copies.

In multithreaded mode, that results in one 4- or 6-thread pool being used for all Copy task invocations, since they now all happen on Thread-backed worker nodes, not separate processes.

### Proposed Feature

We should evaluate changing this strategy for multithreaded mode - especially if testing and measurement shows that the existing shared pool is constantly working.

### Alternative Designs

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.