Skip to content

Feature and ifdef FEATURE_MULTITHREADING#124959

Merged
pavelsavara merged 26 commits intodotnet:mainfrom
pavelsavara:FEATURE_IS_MULTITHREADING_SUPPORTED
Mar 12, 2026
Merged

Feature and ifdef FEATURE_MULTITHREADING#124959
pavelsavara merged 26 commits intodotnet:mainfrom
pavelsavara:FEATURE_IS_MULTITHREADING_SUPPORTED

Conversation

@pavelsavara
Copy link
Member

No description provided.

@pavelsavara pavelsavara added this to the 11.0.0 milestone Feb 27, 2026
@pavelsavara pavelsavara self-assigned this Feb 27, 2026
Copilot AI review requested due to automatic review settings February 27, 2026 11:40
@pavelsavara pavelsavara added arch-wasm WebAssembly architecture os-browser Browser variant of arch-wasm labels Feb 27, 2026
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 refactors the threading feature detection mechanism in the .NET runtime by consolidating multiple threading-related feature flags into a single, consistently-named flag: FEATURE_IS_MULTITHREADING_SUPPORTED. This replaces the previous FEATURE_WASM_MANAGED_THREADS and FEATURE_SINGLE_THREADED flags with clearer, more consistent naming.

Changes:

  • Renamed MSBuild property FeatureWasmManagedThreads to FeatureIsMultithreadingSupported across all project files
  • Renamed C# preprocessor define FEATURE_WASM_MANAGED_THREADS to FEATURE_IS_MULTITHREADING_SUPPORTED
  • Removed FEATURE_SINGLE_THREADED and FeatureSingleThread in favor of checking !FEATURE_IS_MULTITHREADING_SUPPORTED
  • Updated documentation in threads.md to reflect the new naming
  • Updated C/C++ PAL layer code to use FEATURE_IS_MULTITHREADING_SUPPORTED (with appropriate #ifdef/#ifndef usage)

Reviewed changes

Copilot reviewed 68 out of 68 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/mono/wasm/threads.md Updated documentation to reference new feature flag name
src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj Consolidated feature properties, removed separate single-thread property
src/mono/System.Private.CoreLib/src/System/Threading/Monitor.Mono.cs Updated preprocessor directive
src/libraries/System.Threading/src/System.Threading.csproj Updated feature property definition and condition logic
src/libraries/System.Threading/src/System/Threading/*.cs Updated preprocessor directives in source files
src/libraries/System.Threading/ref/System.Threading.cs Updated preprocessor directives in reference assembly
src/libraries/System.Threading.Thread*/ref/*.csproj Updated feature property references in WebAssembly threading projects
src/libraries/System.Threading.ThreadPool*/ref/*.csproj Updated feature property references
src/libraries/System.Threading.Tasks.Parallel/src/*.csproj Removed separate single-thread flag, using unified flag
src/libraries/System.Runtime.InteropServices.JavaScript/src/*.cs Updated all preprocessor directives across JavaScript interop
src/libraries/System.Runtime.InteropServices.JavaScript/src/*.csproj Updated feature property and conditions
src/libraries/System.Runtime.InteropServices.JavaScript/tests/*.cs Updated test code preprocessor directives
src/libraries/System.Private.CoreLib/src/System/Threading/*.cs Updated threading implementation files
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs Refactored conditional compilation blocks
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems Updated file inclusion conditions
src/libraries/System.Private.CoreLib/ref/*.cs Updated reference assembly definitions
src/libraries/System.Net.WebSockets.Client/src/*.cs Updated WebSocket implementation
src/libraries/System.Net.Http/src/System.Net.Http.csproj Removed unused feature property
src/libraries/System.Linq.Parallel/src/*.cs Updated PLINQ implementation files
src/libraries/System.Linq.Parallel/src/System.Linq.Parallel.csproj Consolidated feature flags
src/libraries/Common/src/Interop/Browser/Interop.Runtime.Mono.cs Updated interop declarations
src/coreclr/pal/src/thread/*.cpp Updated PAL thread implementation with inverted conditional logic
src/coreclr/pal/src/synchmgr/*.cpp Updated synchronization manager implementation
src/coreclr/pal/src/CMakeLists.txt Updated CMake definitions
src/coreclr/clrdefinitions.cmake Updated CMake feature definitions
src/coreclr/clr.featuredefines.props Consolidated feature properties
eng/native.wasm.targets Updated native build conditions and CMake arguments

@jkotas
Copy link
Member

jkotas commented Feb 27, 2026

We do not have any FEATURE_IS_.*. FEATURE_ABC means ABC is supported.

I think it should be FeatureMultithreadingSupport / FEATURE_MULTITHREADING_SUPPORT, or just FeatureMultithreading / FEATURE_MULTITHREADING, to match the naming pattern we use for the feature properties and defines.

Copilot AI review requested due to automatic review settings February 27, 2026 14:47
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

Copilot reviewed 68 out of 68 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings February 27, 2026 16:48
@pavelsavara pavelsavara force-pushed the FEATURE_IS_MULTITHREADING_SUPPORTED branch from 4ecec3d to 91b8eb2 Compare February 27, 2026 16:48
@pavelsavara pavelsavara changed the title Feature and ifdef FEATURE_IS_MULTITHREADING_SUPPORTED Feature and ifdef FEATURE_MULTITHREADING Feb 27, 2026
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

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

Copilot AI review requested due to automatic review settings February 27, 2026 17:25
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

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

@pavelsavara pavelsavara force-pushed the FEATURE_IS_MULTITHREADING_SUPPORTED branch from 58c66fa to 97013a8 Compare February 27, 2026 18:34
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

Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings March 5, 2026 05:06
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

Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.

…b.Shared.projitems

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Copilot AI review requested due to automatic review settings March 12, 2026 08:14
…b.Shared.projitems

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
…b.Shared.projitems

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
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

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

…b.Shared.projitems

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 12, 2026 08:31
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

Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks!

@pavelsavara pavelsavara enabled auto-merge (squash) March 12, 2026 18:03
@pavelsavara
Copy link
Member Author

/ba-g unrelated failures

@pavelsavara pavelsavara merged commit 9af7d04 into dotnet:main Mar 12, 2026
167 of 174 checks passed
@pavelsavara pavelsavara deleted the FEATURE_IS_MULTITHREADING_SUPPORTED branch March 12, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-Infrastructure-libraries os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants