On Wed, Feb 21, 2018 at 2:40 PM, Jeremy Manson <jeremyman...@google.com> wrote:
> > 1) Should the ID be a long? The Hotspot thread dump prints it out as > 0x%x, which is an unsigned hexadecimal integer. The type hiding behind it > is platform-dependent, though: a pid_t on Linux, an unsigned long on > Windows, a thread_t on Solaris. I could make it a String instead... > This is very similar to the question of what to do for e.g. Process#pid https://docs.oracle.com/javase/9/docs/api/java/lang/Process.html#pid-- Note the Posixy naming of the method and its long return type. When I was thinking about this 10 years ago, I was expecting us to represent it as a String inside the JVM, which would be more flexible, but it hasn't caused any trouble so far. Since thread ids are even more system dependent, the case for String is stronger. It's at least plausible that there are no native threads on the platform