RFR 9: 8003488 Add Process.getPid

David M. Lloyd david.lloyd at redhat.com
Thu May 22 15:46:30 UTC 2014

On 05/22/2014 10:34 AM, David M. Lloyd wrote:
> On 05/22/2014 08:49 AM, roger riggs wrote:
>> Hi,
>> The webrev has been updated to more completely describe the pid:
>> "The native process id is an identification number that the operating
>> system assigns to the process."
>> Any other comments?
>> Webrev: http://cr.openjdk.java.net/~rriggs/webrev-getpid-8003488/
>> <http://cr.openjdk.java.net/%7Erriggs/webrev-getpid-8003488/>
>> Issue: https://bugs.openjdk.java.net/browse/JDK-8003488
> I guess this is a little late, and minor, but the "jstack" tool uses the
> acronym "nid" for this purpose, which I believe is mapped to the same
> concept (on Linux it is anyway).
> I think either this terminology should be unified on the jstack side, or
> else the method should be called "getNativeId" or "getNid" or something.

Refining that thought - on Linux, process IDs and thread IDs share a 
namespace, but maybe that isn't true on all platforms.  Still calling it 
"getPid" seems very UNIX-specific.  Process.getNativeId() seems "safer" 
or more future-proof to me, somehow.


More information about the core-libs-dev mailing list