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

Allow Boehm to mark from thread-locals #106

Merged
merged 2 commits into from
Jan 17, 2024

Conversation

jacob-hughes
Copy link
Collaborator

In order to support this this PR is split into two commits:

  1. We must disable compiler-based thread local implementation. This is a shame because it's faster than the POSIX thread library impl but it places thread locals in a table in a segment in the binary which Boehm can't scan. It might be possible to fix this in the future, but for now we fallback to using the POSIX thread implementation because there exists a fix for this.

  2. We introduce a thread-local rootset vector, which holds pointers to the current thread's TL values. This rootset is then specifically added to Boehm's mark list so that TL values can be traced.

On UNIX this means that thread_local! will use the pthread specific API
instead of LLVM's compiler's __thread implementation.

This also means we must disable tests which rely on compiler supported
TLS.
This introduces a thread-local rootset vector, which holds pointers to
the current thread's TL values. This rootset is then specifically added
to Boehm's mark list so that TL values can be traced.
@ltratt ltratt added this pull request to the merge queue Jan 17, 2024
Merged via the queue into softdevteam:master with commit 31c3146 Jan 17, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants