Skip to content

Conversation

eduardo-vp
Copy link
Member

@eduardo-vp eduardo-vp commented Jan 23, 2024

Fix ThreadPoolIOEnqueue, ThreadPoolIODequeue, ThreadPoolIOPack in Native Runtime Event Source which are based on the assumption that the NativeOverlapped* comes from the Portable thread pool implementation but it can come from the Windows thread pool implementation as well.

@ghost
Copy link

ghost commented Jan 23, 2024

Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: eduardo-vp
Assignees: eduardo-vp
Labels:

area-System.Diagnostics.Tracing

Milestone: -

@eduardo-vp eduardo-vp marked this pull request as draft January 23, 2024 07:05
@eduardo-vp eduardo-vp marked this pull request as draft January 23, 2024 07:05
@eduardo-vp eduardo-vp changed the title Handle NativeOverlapped* coming from both the Windows or Portable thread pool in NativeRuntimeEventSource.ThreadPoolIOEnque Handle NativeOverlapped* coming from both the Windows or Portable thread pool in NativeRuntimeEventSource Jan 23, 2024
Copy link
Contributor

@kouvel kouvel left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

How do diagnostic tools use this value? Is 0 the best option to make them work seamlessly?

Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I know it's not used for anything specific, just additional info. We used to pass in the actual Overlapped object pointer and later switched to a hash code since that's not a stable value. I'm not sure how useful it is actually, since the NativeOverlapped* is stable, maybe a hash code is not very useful. For the Windows thread pool implementation there is an OverlappedData object that could be used, though it could also be obtained from the NativeOverlapped* if debugging side-by-side with a heap dump.

@tommcdon
Copy link
Member

tommcdon commented Feb 6, 2024

Adding @noahfalk @davmason for additional review

Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

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

Looks fine to me

@eduardo-vp eduardo-vp force-pushed the fix-nres-threadpool-io-enqueue branch from e0dc456 to a3c111c Compare February 8, 2024 23:31
@eduardo-vp
Copy link
Member Author

Removing the test as it could be improved and it should be configured to run with the Windows thread pool. I'll add it separately in another PR and merge this one with the fix only

@eduardo-vp
Copy link
Member Author

/backport to release/8.0-staging

@github-actions github-actions bot unlocked this conversation Mar 13, 2024
Copy link
Contributor

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/8257670127

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 13, 2024
@eduardo-vp eduardo-vp deleted the fix-nres-threadpool-io-enqueue branch May 29, 2024 20:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants