RFR(s): 8209139: globalCounter bootstrap issue

David Holmes david.holmes at oracle.com
Wed Nov 7 09:40:59 UTC 2018


Hi Robbin,

Can't you just use an _initialized flag ?? Or statically initialize 
_java_thread_list to a zero-length list? This seems overly elaborate.

I'm not even concerned about the existing "hack" - checking for 
"Threads::number_of_threads() == 0" has always been a simple way to see 
if you are very early in the init sequence.

Thanks,
David

On 7/11/2018 6:56 PM, Robbin Ehn wrote:
> Hi all, please review.
> 
> When changing the hashtable for SymbolTable we did a hack to handle the 
> case
> when symbols gets inserted before the VM is proper initialized, by doing 
> nothing
> in the GlobalCounter if there is no threads. The problem is that the thread
> creating the VM is not yet added to the VM (non-SMR-thread) and thus
> ThreadsListHandle do not yet work for that thread. Trying to move the 
> addition
> of the creating thread earlier in the bootstrap is troublesome.
> 
> This removes that hack and do a more generic solution for ThreadsList 
> instead.
> To make it safe to verify that we are talking about the bootstrap 
> ThreadsList from a non-SMR-thread we cannot follow that pointer. Using 
> null was intrusive to the code I therefore choose to do a static 
> bootstrap ThreadsList.
> 
> CR: https://bugs.openjdk.java.net/browse/JDK-8209139
> Webrev: http://cr.openjdk.java.net/~rehn/8209139/webrev/
> 
> Tested with use of ThreadsListHandle and GlobalCounter in the 
> problematic init method, passed t1-2 with use of ThreadsListHandle in 
> that init method.
> 
> Thanks, Robbin


More information about the hotspot-runtime-dev mailing list