RFR 9: 8003488 Add Process.getPid

Paul Benedict pbenedict at apache.org
Mon May 12 20:52:08 UTC 2014


I was thinking about this ticket today. Regarding Alan Bateman's comment
that the pid may not be representable as an int/long, I was expecting some
sort of Pid-like-object to be returned. I'd rather see an abstraction that
*might* be able to convert into an int/long ... or even a String, as Martin
B. just said.


Cheers,
Paul


On Mon, May 12, 2014 at 3:47 PM, Martin Buchholz <martinrb at google.com>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
> >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/
> > Issue:  https://bugs.openjdk.java.net/browse/JDK-8003488
> >
> > Thanks, Roger
> >
> >
>



More information about the core-libs-dev mailing list