Skip to content

[work-in-progress][API] RuntimeFeature.IsMultithreadingSupported#124603

Draft
pavelsavara wants to merge 6 commits intodotnet:mainfrom
pavelsavara:IsMultithreadingSupported
Draft

[work-in-progress][API] RuntimeFeature.IsMultithreadingSupported#124603
pavelsavara wants to merge 6 commits intodotnet:mainfrom
pavelsavara:IsMultithreadingSupported

Conversation

@pavelsavara
Copy link
Member

Fixes #77541
Continuation of #123329

Mostly renames

  • internal Thread.IsSingleThreaded -> public RuntimeFeature.IsMultithreadingSupported
  • internal Thread.ThrowIfSingleThreaded() -> internal RuntimeFeature.ThrowIfMultithreadingIsNotSupported()
  • PlatformDetection.IsThreadingSupported -> PlatformDetection.IsMultithreadingSupported
  • PlatformDetection.IsNotWasmThreadingSupported -> PlatformDetection.IsNotMultithreadingSupported

@pavelsavara pavelsavara added this to the 11.0.0 milestone Feb 19, 2026
@pavelsavara pavelsavara self-assigned this Feb 19, 2026
Copilot AI review requested due to automatic review settings February 19, 2026 16:30
@pavelsavara pavelsavara added area-System.Threading os-browser Browser variant of arch-wasm labels Feb 19, 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 pull request introduces a new public API RuntimeFeature.IsMultithreadingSupported to replace the internal Thread.IsSingleThreaded property. This is part of API proposal #77541 to provide a public feature flag for determining if multithreading is supported on the current platform (particularly relevant for single-threaded WebAssembly environments).

Changes:

  • Introduces public RuntimeFeature.IsMultithreadingSupported property and internal ThrowIfMultithreadingIsNotSupported() method
  • Removes internal Thread.IsSingleThreaded and Thread.ThrowIfSingleThreaded()
  • Renames PlatformDetection.IsThreadingSupportedIsMultithreadingSupported and IsNotWasmThreadingSupportedIsNotMultithreadingSupported
  • Updates hundreds of test files to use the new naming convention
  • Configures the feature switch in MSBuild targets for WebAssembly

Reviewed changes

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

Show a summary per file
File Description
System.Runtime.cs Adds public API surface for IsMultithreadingSupported
RuntimeFeature.cs Implements new property and internal throw helper
Thread.cs Removes old IsSingleThreaded API
PlatformDetection.cs (multiple) Updates to use RuntimeFeature instead of environment variable
Environment.cs Uses new API for ProcessorCount logic
Microsoft.NET.Sdk.WebAssembly.Browser.targets Configures feature switch for WASM
tests.browser.targets Removes IsBrowserThreadingSupported environment variable
200+ test files Updates ConditionalFact/Theory attributes to use new naming

Copilot AI review requested due to automatic review settings February 19, 2026 17:56
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 273 out of 273 changed files in this pull request and generated no new comments.

@jkotas
Copy link
Member

jkotas commented Feb 19, 2026

IsThreadingSupported -> IsMultithreadingSupported

Can you do 1 boring prep PR that has just this rename and nothing else, and do the rest in this PR? It is hard to find any interesting changes in 250+ changed files.

NumericIntPtr => true,

nameof(IsDynamicCodeSupported) => IsDynamicCodeSupported,
nameof(IsDynamicCodeCompiled) => IsDynamicCodeCompiled,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
nameof(IsDynamicCodeCompiled) => IsDynamicCodeCompiled,
nameof(IsMultithreadingSupported) => IsMultithreadingSupported,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Threading os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: RuntimeFeature.IsMultithreadingSupported

3 participants

Comments