Background and Motivation
The Http.Sys server implementation in ASP.NET Core interacts with various native windows APIs using ThreadPoolBoundHandle. Most of these interactions don't require a capture of the execution context and in some cases it's detrimental (e.g. dotnet/aspnetcore#26128). There should be a way to avoid capturing the ExecutionContext when creating a NativeOverlapped* from a ThreadPoolBoundHandle:
Proposed API
namespace System.Threading
{
public sealed class ThreadPoolBoundHandle
{
+ [CLSCompliant(false)]
+ public unsafe NativeOverlapped* AllocateUnsafeNativeOverlapped(IOCompletionCallback callback, object? state, object? pinData);
}
}
Background and Motivation
The Http.Sys server implementation in ASP.NET Core interacts with various native windows APIs using
ThreadPoolBoundHandle. Most of these interactions don't require a capture of the execution context and in some cases it's detrimental (e.g. dotnet/aspnetcore#26128). There should be a way to avoid capturing the ExecutionContext when creating aNativeOverlapped*from aThreadPoolBoundHandle:Proposed API
namespace System.Threading { public sealed class ThreadPoolBoundHandle { + [CLSCompliant(false)] + public unsafe NativeOverlapped* AllocateUnsafeNativeOverlapped(IOCompletionCallback callback, object? state, object? pinData); } }