RFR: 8282469: Allow considered use of C++ thread_local in Hotspot

Daniel D.Daugherty dcubed at openjdk.java.net
Tue Mar 8 21:36:08 UTC 2022


On Mon, 7 Mar 2022 06:12:03 GMT, David Holmes <dholmes at openjdk.org> wrote:

> This patch provides a means for using C++ `thread_local` when it is essential - see JBS for more details.
> 
> There are three parts:
> 
> 1. Add the new #define for `thread_local`
> 2. Remove `operator_new.cpp` as use of C++ `thread_local` with a non-trival cleanup actions requires use of global operators new/delete. These are still excluded for hotspot use via a link-time check.
> 3. Remove the prohibition on using `thread_local` from the hotspot style guide
> 
> Due to the way hotspot style guide changes must be done, part 3 is being done under a sub-task in PR https://github.com/openjdk/jdk/pull/7720 and the two PR's will integrate at the same time.
> 
> Testing:
>   - manual testing of the Panama usecase as referenced in the JBS issue
>   - Tiers 1-3
> 
> Thanks,
> David

Thumbs up.

I had to reread these two sentences a couple of times:

2a) Remove operator_new.cpp as use of C++ thread_local with a non-trival cleanup actions requires use of global operators new/delete.
2b) These are still excluded for hotspot use via a link-time check.

I think I've convinced myself that the link-time check won't run afoul of the
uses that are planned for Panama. I did that by rephrasing the above into:

> Panama's use of thread_local will have non-trival cleanup actions and those
> will not be complained about by the link-time check.

Please let me know if I have this correct.

-------------

Marked as reviewed by dcubed (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7719


More information about the hotspot-dev mailing list