Thread.getState() very slow

Martin Buchholz martinrb at google.com
Mon Jul 12 02:02:23 UTC 2010


On Sun, Jul 11, 2010 at 15:20, David Holmes <David.Holmes at oracle.com> wrote:

> I thought this would be fairly simple but looking deeper into this it is a
> lot more complicated than I thought. There is a three-level mapping from:
>
> OS/VM thread state -> VM ThreadStatus -> java.lang.ThreadState
>
> and it is a M:N:1 mapping

I'm surprised by this as well.

I had also assumed that Thread.getState would be cheap, and simple.

> Some input from the original implementors would be useful (Martin? Mandy?

I don't know anything about the implementation of Thread.getState.  Mandy?

Martin



More information about the core-libs-dev mailing list