RFR 9: 8003488 Add Process.getPid

roger riggs roger.riggs at oracle.com
Mon May 12 20:50:59 UTC 2014

Hi Martin,

Alan mentioned this case but it seemed more difficult to use than the 

For the other parts of JEP 102, I expect to represent a process with a type
that can have additional methods. That type would provide stronger 
typing and
a set of useful operations.  It seems less desirable to use a String in 
those cases.


On 5/12/2014 4:47 PM, Martin Buchholz wrote:
> Thanks for taking on yet another task that has been on my TODO list 
> for a decade.
> I decided many years ago that the "process identifier" should actually 
> be a string (or at least not something as constrained as an int), in 
> keeping with Java's OS-independent nature, even though all 
> implementations may in fact use an integer.  IIRC, Apollo computers 
> used a hostname/int pair as a process identifier, and such a 
> convention may become popular again in the future.
> Furthermore, returning a string is in practice at least as convenient, 
> since the only thing you can typically do with a pid today is pass it 
> as a string to a system command like "kill".
> On Mon, May 12, 2014 at 12:44 PM, roger riggs <roger.riggs at oracle.com 
> <mailto:roger.riggs at oracle.com>> wrote:
>     Please review and comment on this long requested addition to
>     provide the
>     native process id of a spawned Process.
>     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
>     Thanks, Roger

More information about the core-libs-dev mailing list