RFR: 8223056: Remove Type-Stable-Memory support for Parkers

David Holmes david.holmes at oracle.com
Wed Jan 20 05:13:20 UTC 2021


Hi Coleen,

Thanks for looking at this.

On 20/01/2021 5:01 am, Coleen Phillimore wrote:
> 
> Changes requested by coleenp (Reviewer).
> 
> src/hotspot/share/runtime/park.hpp line 58:
> 
>> 56:
>> 57:  public:
>> 58:   Parker() : PlatformParker(), _counter(0) {
> 
> nit generally when empty } is on the same line as {.

Fixed.

 > I can't find what _counter is used for.

It is the permit counter for the Parker - see the implementations of 
park() and unpark() in os_posix.cpp. But if the _counter is Posix only 
we should move it into PlatformParker - done.

> src/hotspot/share/runtime/park.cpp line 112:
> 
>> 110:
>> 111: void ParkEvent::operator delete (void * a) {
>> 112:   // ParkEvents are type-stable and immortal ...
> 
> Do ParkEvents still need to be type-stable and immortal as a future RFE?

Yes - see ObjectMonitor::ExitEpilog. We'd have to do a lot of work to be 
able to get rid of TSM for ParkEvents.

> src/hotspot/os/windows/os_windows.hpp line 205:
> 
>> 203:     CloseHandle(_ParkEvent);
>> 204:   }
>> 205: };
> 
> Should the implementation of the constructor and destructor be in the .cpp file so that thread.hpp doesn't need to include whatever windows os specific file needed to import CreateEvent and CloseHandle?

Sorry I don't follow the connection between os_windows.hpp and 
thread.hpp. But note that PlatformEvent in os_windows.hpp already uses 
CreateEvent so I have not changed any dependencies in that regard.

BTW it struck me as a poor choice of naming to have a PlatformParker 
variable be called _ParkEvent when we have a ParkEvent class, so I've 
renamed it to _ParkerEvent.

Thanks,
David

> 
> -------------
> 
> PR: https://git.openjdk.java.net/jdk/pull/2089
> 


More information about the hotspot-runtime-dev mailing list