Jas*_*per 1 java performance multithreading stack-trace
在为Java应用程序获取Thread Dump之后,会显示几个线程快照,如下所示:
Thread t@384
java.lang.Thread.State: RUNNABLE
at xmlpdf.text.Word.allocateArrays(Word.java:205)
at xmlpdf.text.Word.calculateWidth(Word.java:237)
at xmlpdf.text.TextFormatter.format(TextFormatter.java:167)
at xmlpdf.text.TextFormatter.formatToWidthImpl(TextFormatter.java:116)
at xmlpdf.text.TextBlock.formatToWidthImpl(TextBlock.java:71)
at xmlpdf.tables.TextCell.formatToWidthImpl(TextCell.java:45)
at xmlpdf.tables.Cell.formatToWidth(Cell.java:349)
at xmlpdf.tables.Row.assignCellWidths(Row.java:97)
at xmlpdf.tables.Table.layout(Table.java:354)
at xmlpdf.tables.Table.formatRowsToWidth(Table.java:329)
at xmlpdf.tables.Table.formatToWidthImpl(Table.java:373)
at xmlpdf.Block.formatToWidth(Block.java:57)
at xmlpdf.renderer.Page.formatWidthAndHeight(Page.java:200)
at xmlpdf.renderer.Page.addBlockWhichIsNotFooterWholePagesOnly(Page.java:1026)
.....
Run Code Online (Sandbox Code Playgroud)
几个相同的线程(由线程名称标识)处于完全相同的状态.
仅供参考通过JMX进行检查还显示这些线程运行了4个小时.
题:
一个线程如何处于一种RUNNABLE状态但Stack Trace它的状态却显示它正在做某事?
我认为RUNNABLE总是意味着线程可用于处理任何新任务而不是处理任务.