Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Green Threads] Unique managed thread objects/ids are not implemented #2014

Closed
davidwrighton opened this issue Oct 3, 2022 · 0 comments
Closed
Assignees
Labels
area-green-threads Green threads

Comments

@davidwrighton
Copy link
Member

davidwrighton commented Oct 3, 2022

Known issue from #2002

@davidwrighton davidwrighton added the area-green-threads Green threads label Oct 3, 2022
@davidwrighton davidwrighton self-assigned this Oct 5, 2022
davidwrighton added a commit that referenced this issue Oct 18, 2022
This adds managed `Thread` objects for green threads as well as unique managed thread ids. There is a test for that. 

In addition this adds logic to moves handling of Monitor locks to a per-green thread structure. There is a simple test for that scenario as well.

In addition it fixes a number of bugs

- In the reverse p/invoke logic where the current native `Thread*` pointer is cached, and when we hop threads isn't properly restored. (See change in jithelpers.cpp)
- In the forward P/Invoke case, this change disables standard PInvoke inlining in favor of the helper method approach. This works for everything but IL stubs (as the IL stub codegen sets specific values used for performing callstack walking.)
- This also fixes bugs where the stack limits were not properly updated on resume
- This fixes bugs where in the presence of optimization, when the thread was resumed on a different thread the Thread* was not refreshed from the underlying TLS data structure. This issue was found in several functions in C++ (which are now marked with optimizations disabled)

Fixes #2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-green-threads Green threads
Projects
None yet
Development

No branches or pull requests

1 participant