RFR: 8203227: Introduce os::processor_id() for Linux and Solaris

Per Liden per.liden at oracle.com
Tue May 15 15:07:35 UTC 2018


This patch introduces os::processor_id() to get the id of the CPU that 
the caller is currently executing on. Obviously, the returned id should 
only be viewed as a strong hint, since the information might be 
instantly out-of-date.

We're using this in ZGC to do various CPU-local operations. We currently 
only need this for Linux and Solaris, which is what this patch adds. 
Support for additional platforms can be added when needed. I didn't add 
dummy os::processor_id() to the not-yet-implemented platforms, since I 
think it's better to get a early compile-time error instead of a 
Unimplemented() at runtime, if you try to use them.

Bug: https://bugs.openjdk.java.net/browse/JDK-8203227
Webrev: http://cr.openjdk.java.net/~pliden/8203227/webrev.0

/Per


More information about the hotspot-dev mailing list