Skip to content

Add new multithreaded APIs#12625

Merged
AR-May merged 5 commits intodotnet:mainfrom
AR-May:add-mt-apis
Oct 14, 2025
Merged

Add new multithreaded APIs#12625
AR-May merged 5 commits intodotnet:mainfrom
AR-May:add-mt-apis

Conversation

@AR-May
Copy link
Member

@AR-May AR-May commented Oct 8, 2025

Related to #11828

Changes:
This PR introduces the core APIs that enable thread-safe task execution in MSBuild's multithreaded execution model. These APIs provide safe alternatives to global process state operations, allowing IMultithreadable tasks to run concurrently within a single MSBuild process.

Node:
Adding multithreaded APIs in order to unblock #12617
Extracted APIs from #12608

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces core APIs to enable thread-safe task execution in MSBuild's multithreaded execution model. The changes provide safe alternatives to global process state operations, allowing IMultithreadable tasks to run concurrently within a single MSBuild process.

Key changes:

  • New TaskEnvironment class providing thread-safe environment variable and path operations
  • AbsolutePath struct for safe path handling
  • IMultiThreadableTask interface for tasks that can execute in parallel
  • MSBuildMultiThreadableTaskAttribute for marking existing tasks as thread-safe

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Framework/TaskEnvironment.cs Core API providing thread-safe environment operations and path resolution
src/Framework/PathHelpers/AbsolutePath.cs Immutable struct representing absolute file system paths
src/Framework/IMultiThreadableTask.cs Interface for tasks capable of thread-safe execution
src/Framework/MSBuildMultiThreadableTaskAttribute.cs Attribute for marking existing tasks as thread-safe
documentation/specs/multithreading/thread-safe-tasks.md Updates to specification removing virtual modifiers

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@AR-May
Copy link
Member Author

AR-May commented Oct 9, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AR-May
Copy link
Member Author

AR-May commented Oct 9, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@JanProvaznik JanProvaznik left a comment

Choose a reason for hiding this comment

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

just venting some thoughts about doc comments, the shape of the code is good, approved, but needs another reviewer

@AR-May AR-May requested a review from baronfel October 13, 2025 14:15
@baronfel
Copy link
Member

I added a bit of fit-and-finish to the existing API docs because I couldn't help myself.

Copy link
Member

@JanProvaznik JanProvaznik left a comment

Choose a reason for hiding this comment

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

:shipit:

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.

4 participants