java runnable wait_java – RUNNABLE Thread.State,但在Object.wait()

我提取了一个JStack我的容器进程,并让线程运行在那里,并按照Thread.state分组的以下分发:

count thread state

67 RUNNABLE

1 TIMED_WAITING (on object monitor)

8 TIMED_WAITING (parking)

4 TIMED_WAITING (sleeping)

3 WAITING (on object monitor)

17 WAITING (parking)

对于可运行的线程,我有以下描述:

"http-bio-8080-exec-55" daemon prio=10 tid=0x000000002cbab300 nid=0x642b in Object.wait() [0x00002ab37ad11000]

java.lang.Thread.State: RUNNABLE

at com.mysema.query.jpa.impl.JPAQuery.(JPAQuery.java:44)

at net.mbppcb.cube.repository.TransactionDaoImpl.findByBusinessId(TransactionDaoImpl.java:73)

at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:601)

at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)

...

RUNNABLE状态中的线程数如上所示,随着时间的推移而增加,似乎挂起.如果他们认为被封锁,他们不应该在BLOCKED状态吗?还是应该在WAITING状态?有奇怪的是有RUNNABLE线程,但在Object.wait()不是吗?

更新1

我可以在文档中看到:

A thread in the runnable state is executing in the Java virtual

machine but it may be waiting for other resources from the operating

system such as processor.

我怎么弄清楚等待的线程是什么?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值