RFR 9: 8003488 Add Process.getPid
Martin Buchholz
martinrb at google.com
Mon May 12 20:59:24 UTC 2014
Alan has by far the most experience with system-dependent java objects that
have some kind of static structure, but enough flexibility to adapt
dynamically to different systems. Perhaps Alan could apply some of that
design expertise to e.g. java.lang.Process.
On Mon, May 12, 2014 at 1:52 PM, Paul Benedict <pbenedict at apache.org> wrote:
> 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