Skip to content

API Proposal: Add ThreadPoolBoundHandle.AllocateUnsafeNativeOverlapped  #42549

@davidfowl

Description

@davidfowl

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);
    }
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions