uzons
uzons
2015-03-21 15:49

线程一直处于RUNNABLE,也没有发现阻塞或是死锁的情况?

  • runnable
  • 线程

我写的是一个频繁访问网络的爬虫,启了20个线程;
但是老实跑了一段时间,线程全部处于RUNNABLE状态了;
网络使用的是httpclient3.1;
我把threaddump给放到下面:

 "Thread-19" #30 prio=5 os_prio=0 tid=0x0000000059b3d000 nid=0xcb4 runnable [0x000000005ba1e000]
   java.lang.Thread.State: RUNNABLE
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:150)
    at java.net.SocketInputStream.read(SocketInputStream.java:121)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
    - locked <0x0000000086f05c90> (a java.io.BufferedInputStream)
    at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
    at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
    at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
    at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
    at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
    at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
    at com.uzons.domain.search.v2.searcher.EBChecker.validate(EBChecker.java:34)
    at com.uzons.domain.search.v2.taskscheduler.DomainJob.exec(DomainJob.java:28)
    at com.uzons.domain.search.v2.taskscheduler.DomainScheduler.execute(DomainScheduler.java:110)
    at com.uzons.domain.search.v2.taskscheduler.DomainScheduler.run(DomainScheduler.java:92)

   Locked ownable synchronizers:
    - None

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

3条回答

为你推荐