线程池拒绝策略-CallerRunsPolicy

线程池拒绝策略-CallerRunsPolicy

官方说明: 被拒绝任务的处理程序,它直接在execute方法的调用线程中运行被拒绝的任务,除非执行器已关闭,在这种情况下,该任务将被丢弃。

    /**
     * A handler for rejected tasks that runs the rejected task
     * directly in the calling thread of the {@code execute} method,
     * unless the executor has been shut down, in which case the task
     * is discarded.
     */
    public static class CallerRunsPolicy implements RejectedExecutionHandler {
        /**
         * Creates a {@code CallerRunsPolicy}.
         */
        public CallerRunsPolicy() { }

        /**
         * Executes task r in the caller's thread, unless the executor
         * has been shut down, in which case the task is discarded.
         *
         * @param r the runnable task requested to be executed
         * @param e the executor attempting to execute this task
         */
        public void rejectedExecution(Runnable r, ThreadPoolExecutor e) {
            if (!e.isShutdown()) {
                r.run();
            }
        }
    }

代码实验:观察CallerRunsPolicy运行机制

public static void main(String[] args) {
        LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<>(10);
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
                3,
                5,
                5,
                TimeUnit.MINUTES,
                queue,
                NAMED_ORDER_SYNC,
                new ThreadPoolExecutor.CallerRunsPolicy());
        for (int i = 0; i < 100; i++) {
            threadPoolExecutor.execute(() -> {
                System.out.println("当前执行线程为:" +Thread.currentThread().getName() + "   activeCount: "+threadPoolExecutor.getActiveCount() + " - largestPoolSize:" + threadPoolExecutor.getLargestPoolSize() + " - queueSize:" + threadPoolExecutor.getQueue().size());
                try {
                    TimeUnit.SECONDS.sleep(2);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            });
        }
    }

实验结果:可以看到,当阻塞队列打满后且达到最大线程数时,新加入的任务会使用提交者,也就是主线程去执行。此时整体的执行情况是线程池和主线程共同执行任务,直到任务执行完毕。

/iCoding/java/jdk8u242-b08/bin/java -javaagent:/iCoding/ideaIU-2021.3.2/ide/lib/idea_rt.jar=48779:/iCoding/ideaIU-2021.3.2/ide/bin -Dfile.encoding=UTF-8 -classpath /iCoding/java/jdk8u242-b08/jre/lib/charsets.jar:/iCoding/java/jdk8u242-b08/jre/lib/ext/cldrdata.jar:/iCoding/java/jdk8u242-b08/jre/lib/ext/dnsns.jar:/iCoding/java/jdk8u242-b08/jre/lib/ext/jaccess.jar:/iCoding/java/jdk8u242-b08/jre/lib/ext/localedata.jar:/iCoding/java/jdk8u242-b08/jre/lib/ext/nashorn.jar:/iCoding/java/jdk8u242-b08/jre/lib/ext/sunec.jar:/iCoding/java/jdk8u242-b08/jre/lib/ext/sunjce_provider.jar:/iCoding/java/jdk8u242-b08/jre/lib/ext/sunpkcs11.jar:/iCoding/java/jdk8u242-b08/jre/lib/ext/zipfs.jar:/iCoding/java/jdk8u242-b08/jre/lib/jce.jar:/iCoding/java/jdk8u242-b08/jre/lib/jsse.jar:/iCoding/java/jdk8u242-b08/jre/lib/management-agent.jar:/iCoding/java/jdk8u242-b08/jre/lib/resources.jar:/iCoding/java/jdk8u242-b08/jre/lib/rt.jar:/root/codes/baidu_health_tradeflow-b2c/baidu/health/tc-search/tc-search-common/target/classes:/root/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/root/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:/root/.m2/repository/org/slf4j/slf4j-api/1.7.31/slf4j-api-1.7.31.jar:/root/.m2/repository/org/springframework/spring-core/5.0.11.RELEASE/spring-core-5.0.11.RELEASE.jar:/root/.m2/repository/org/springframework/spring-jcl/5.0.11.RELEASE/spring-jcl-5.0.11.RELEASE.jar:/root/.m2/repository/org/springframework/spring-context/5.0.11.RELEASE/spring-context-5.0.11.RELEASE.jar:/root/.m2/repository/org/springframework/spring-aop/5.0.11.RELEASE/spring-aop-5.0.11.RELEASE.jar:/root/.m2/repository/org/springframework/spring-beans/5.0.11.RELEASE/spring-beans-5.0.11.RELEASE.jar:/root/.m2/repository/org/springframework/spring-expression/5.0.11.RELEASE/spring-expression-5.0.11.RELEASE.jar:/root/.m2/repository/org/springframework/boot/spring-boot/2.0.7.RELEASE/spring-boot-2.0.7.RELEASE.jar:/root/.m2/repository/org/apache/commons/commons-lang3/3.7/commons-lang3-3.7.jar:/root/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.0.7.RELEASE/spring-boot-autoconfigure-2.0.7.RELEASE.jar:/root/.m2/repository/com/github/rholder/guava-retrying/2.0.0/guava-retrying-2.0.0.jar:/root/.m2/repository/com/google/guava/guava/19.0/guava-19.0.jar:/root/.m2/repository/com/google/code/findbugs/jsr305/2.0.2/jsr305-2.0.2.jar:/root/.m2/repository/commons-codec/commons-codec/1.11/commons-codec-1.11.jar:/root/.m2/repository/cn/hutool/hutool-all/5.5.9/hutool-all-5.5.9.jar:/root/.m2/repository/com/baidu/health/doraemon-api/1.0.8-SNAPSHOT/doraemon-api-1.0.8-20211227.150145-12.jar:/root/.m2/repository/org/mapstruct/mapstruct-jdk8/1.2.0.Final/mapstruct-jdk8-1.2.0.Final.jar:/root/.m2/repository/org/projectlombok/lombok/1.16.22/lombok-1.16.22.jar:/root/.m2/repository/org/mapstruct/mapstruct-processor/1.2.0.Final/mapstruct-processor-1.2.0.Final.jar:/root/.m2/repository/com/alibaba/transmittable-thread-local/2.12.4/transmittable-thread-local-2.12.4.jar:/root/.m2/repository/com/baidu/health/doraemon-logger/1.1.8/doraemon-logger-1.1.8.jar:/root/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.11.2/jackson-annotations-2.11.2.jar:/root/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.11.2/jackson-core-2.11.2.jar:/root/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.11.2/jackson-databind-2.11.2.jar:/root/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.11.2/jackson-datatype-jsr310-2.11.2.jar:/root/.m2/repository/com/baidu/health/doraemon-agent-starter/1.0.3-SNAPSHOT/doraemon-agent-starter-1.0.3-20230714.103958-8.jar:/root/.m2/repository/com/baidu/health/doraemon-kernel/1.0.3-SNAPSHOT/doraemon-kernel-1.0.3-20230714.103911-8.jar:/root/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.6.20/kotlin-stdlib-1.6.20.jar:/root/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-common/1.6.20/kotlin-stdlib-common-1.6.20.jar:/root/.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar:/root/.m2/repository/com/squareup/okhttp3/okhttp/4.10.0/okhttp-4.10.0.jar:/root/.m2/repository/com/squareup/okio/okio-jvm/3.0.0/okio-jvm-3.0.0.jar:/root/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.2.71/kotlin-stdlib-jdk8-1.2.71.jar:/root/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.2.71/kotlin-stdlib-jdk7-1.2.71.jar:/root/.m2/repository/net/bytebuddy/byte-buddy/1.13.0/byte-buddy-1.13.0.jar:/root/.m2/repository/net/bytebuddy/byte-buddy-agent/1.13.0/byte-buddy-agent-1.13.0.jar:/root/.m2/repository/com/google/auto/service/auto-service-annotations/1.0.1/auto-service-annotations-1.0.1.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-api/1.21.0/opentelemetry-api-1.21.0.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-context/1.21.0/opentelemetry-context-1.21.0.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-sdk/1.21.0/opentelemetry-sdk-1.21.0.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-sdk-common/1.21.0/opentelemetry-sdk-common-1.21.0.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-sdk-trace/1.21.0/opentelemetry-sdk-trace-1.21.0.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-sdk-metrics/1.21.0/opentelemetry-sdk-metrics-1.21.0.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-sdk-logs/1.21.0-alpha/opentelemetry-sdk-logs-1.21.0-alpha.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-api-logs/1.21.0-alpha/opentelemetry-api-logs-1.21.0-alpha.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-exporter-common/1.21.0/opentelemetry-exporter-common-1.21.0.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-exporter-jaeger/1.21.0/opentelemetry-exporter-jaeger-1.21.0.jar:/root/.m2/repository/com/fasterxml/jackson/jr/jackson-jr-objects/2.11.2/jackson-jr-objects-2.11.2.jar:/root/.m2/repository/io/opentelemetry/javaagent/opentelemetry-javaagent-extension-api/1.23.0-alpha/opentelemetry-javaagent-extension-api-1.23.0-alpha.jar:/root/.m2/repository/net/bytebuddy/byte-buddy-dep/1.13.0/byte-buddy-dep-1.13.0.jar:/root/.m2/repository/org/ow2/asm/asm/9.4/asm-9.4.jar:/root/.m2/repository/org/ow2/asm/asm-commons/9.4/asm-commons-9.4.jar:/root/.m2/repository/io/opentelemetry/instrumentation/opentelemetry-instrumentation-api/1.23.0/opentelemetry-instrumentation-api-1.23.0.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-sdk-extension-autoconfigure/1.23.1-alpha/opentelemetry-sdk-extension-autoconfigure-1.23.1-alpha.jar:/root/.m2/repository/io/jaegertracing/jaeger-client/1.8.1/jaeger-client-1.8.1.jar:/root/.m2/repository/io/jaegertracing/jaeger-thrift/1.8.1/jaeger-thrift-1.8.1.jar:/root/.m2/repository/org/apache/thrift/libthrift/0.15.0/libthrift-0.15.0.jar:/root/.m2/repository/io/jaegertracing/jaeger-core/1.8.1/jaeger-core-1.8.1.jar:/root/.m2/repository/io/opentracing/opentracing-api/0.33.0/opentracing-api-0.33.0.jar:/root/.m2/repository/io/opentracing/opentracing-util/0.33.0/opentracing-util-0.33.0.jar:/root/.m2/repository/io/opentracing/opentracing-noop/0.33.0/opentracing-noop-0.33.0.jar:/root/.m2/repository/io/jaegertracing/jaeger-tracerresolver/1.8.1/jaeger-tracerresolver-1.8.1.jar:/root/.m2/repository/io/opentracing/contrib/opentracing-tracerresolver/0.1.8/opentracing-tracerresolver-0.1.8.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-exporter-jaeger-thrift/1.21.0/opentelemetry-exporter-jaeger-thrift-1.21.0.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-exporter-logging/1.21.0/opentelemetry-exporter-logging-1.21.0.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-semconv/1.21.0-alpha/opentelemetry-semconv-1.21.0-alpha.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-sdk-extension-autoconfigure-spi/1.21.0/opentelemetry-sdk-extension-autoconfigure-spi-1.21.0.jar:/root/.m2/repository/io/opentelemetry/opentelemetry-sdk-extension-jaeger-remote-sampler/1.21.0/opentelemetry-sdk-extension-jaeger-remote-sampler-1.21.0.jar:/root/.m2/repository/com/baidu/health/doraemon-bdrp-javaagent/1.0.3-SNAPSHOT/doraemon-bdrp-javaagent-1.0.3-20230714.103924-8.jar:/root/.m2/repository/com/baidu/health/doraemon-bdrp-common/1.0.3-SNAPSHOT/doraemon-bdrp-common-1.0.3-20230714.103916-8.jar:/root/.m2/repository/com/baidu/health/doraemon-starlight-javaagent/1.0.3-SNAPSHOT/doraemon-starlight-javaagent-1.0.3-20230714.103947-8.jar:/root/.m2/repository/com/baidu/health/doraemon-starlight-library/1.0.3-SNAPSHOT/doraemon-starlight-library-1.0.3-20230714.103950-8.jar:/root/.m2/repository/com/baidu/health/doraemon-mybatis-library/1.0.3-SNAPSHOT/doraemon-mybatis-library-1.0.3-20230714.103955-8.jar:/root/codes/baidu_health_tradeflow-b2c/baidu/health/tc-search/tc-search-api/target/classes:/root/.m2/repository/com/baidu/cloud/spring-cloud-baidu-thirdparty-commons/2020.0.2-SNAPSHOT/spring-cloud-baidu-thirdparty-commons-2020.0.2-20210127.131051-2.jar:/root/.m2/repository/com/baidu/health/tradecenter-api/1.1.1-SNAPSHOT/tradecenter-api-1.1.1-20220701.065616-12.jar:/root/.m2/repository/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar:/root/.m2/repository/com/baidu/cloud/spring-cloud-starter-baidu-redis/2022.0.4/spring-cloud-starter-baidu-redis-2022.0.4.jar:/root/.m2/repository/org/springframework/boot/spring-boot-starter/2.0.7.RELEASE/spring-boot-starter-2.0.7.RELEASE.jar:/root/.m2/repository/org/springframework/boot/spring-boot-starter-logging/2.0.7.RELEASE/spring-boot-starter-logging-2.0.7.RELEASE.jar:/root/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.10.0/log4j-to-slf4j-2.10.0.jar:/root/.m2/repository/org/apache/logging/log4j/log4j-api/2.10.0/log4j-api-2.10.0.jar:/root/.m2/repository/org/slf4j/jul-to-slf4j/1.7.31/jul-to-slf4j-1.7.31.jar:/root/.m2/repository/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar:/root/.m2/repository/org/yaml/snakeyaml/1.19/snakeyaml-1.19.jar:/root/.m2/repository/org/springframework/boot/spring-boot-starter-data-redis/2.0.7.RELEASE/spring-boot-starter-data-redis-2.0.7.RELEASE.jar:/root/.m2/repository/org/springframework/data/spring-data-redis/2.0.12.RELEASE/spring-data-redis-2.0.12.RELEASE.jar:/root/.m2/repository/org/springframework/data/spring-data-keyvalue/2.0.12.RELEASE/spring-data-keyvalue-2.0.12.RELEASE.jar:/root/.m2/repository/org/springframework/data/spring-data-commons/2.0.12.RELEASE/spring-data-commons-2.0.12.RELEASE.jar:/root/.m2/repository/org/springframework/spring-tx/5.0.11.RELEASE/spring-tx-5.0.11.RELEASE.jar:/root/.m2/repository/org/springframework/spring-oxm/5.0.11.RELEASE/spring-oxm-5.0.11.RELEASE.jar:/root/.m2/repository/org/springframework/spring-context-support/5.0.11.RELEASE/spring-context-support-5.0.11.RELEASE.jar:/root/.m2/repository/io/lettuce/lettuce-core/5.0.5.RELEASE/lettuce-core-5.0.5.RELEASE.jar:/root/.m2/repository/io/projectreactor/reactor-core/3.1.12.RELEASE/reactor-core-3.1.12.RELEASE.jar:/root/.m2/repository/org/reactivestreams/reactive-streams/1.0.2/reactive-streams-1.0.2.jar:/root/.m2/repository/io/netty/netty-common/4.1.31.Final/netty-common-4.1.31.Final.jar:/root/.m2/repository/io/netty/netty-transport/4.1.31.Final/netty-transport-4.1.31.Final.jar:/root/.m2/repository/io/netty/netty-buffer/4.1.31.Final/netty-buffer-4.1.31.Final.jar:/root/.m2/repository/io/netty/netty-resolver/4.1.31.Final/netty-resolver-4.1.31.Final.jar:/root/.m2/repository/io/netty/netty-handler/4.1.31.Final/netty-handler-4.1.31.Final.jar:/root/.m2/repository/io/netty/netty-codec/4.1.31.Final/netty-codec-4.1.31.Final.jar:/root/.m2/repository/org/apache/commons/commons-pool2/2.5.0/commons-pool2-2.5.0.jar:/root/.m2/repository/com/baidu/bdrp-client/1.1.35-SNAPSHOT/bdrp-client-1.1.35-20221117.104652-11.jar:/root/.m2/repository/redis/clients/jedis/2.9.0/jedis-2.9.0.jar:/root/.m2/repository/com/baidu/bns-client-spring/1.4.12-SNAPSHOT/bns-client-spring-1.4.12-20221117.103626-3.jar:/root/.m2/repository/com/baidu/bns-core/1.4.12-SNAPSHOT/bns-core-1.4.12-20221117.103620-3.jar:/root/.m2/repository/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar:/root/.m2/repository/com/google/protobuf/protobuf-java/3.19.4/protobuf-java-3.19.4.jar:/root/.m2/repository/com/baidu/searchbox/blog4j-sdk/1.4.2-SNAPSHOT/blog4j-sdk-1.4.2-20191009.032601-43.jar:/root/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:/root/.m2/repository/junit/junit/4.12/junit-4.12.jar:/root/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/root/.m2/repository/org/apache/commons/commons-collections4/4.1/commons-collections4-4.1.jar com.baidu.health.tcsearch.common.util.ThreadPoolUtil
当前执行线程为:sync-or-search   activeCount: 3 - largestPoolSize:3 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 4 - largestPoolSize:4 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 3 - largestPoolSize:4 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:main   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 4 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:9
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:main   activeCount: 5 - largestPoolSize:5 - queueSize:9
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:9
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:8
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:5
当前执行线程为:main   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:7
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:9
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:8
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:7
当前执行线程为:main   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:8
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:9
当前执行线程为:sync-or-search   activeCount: 4 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:5
当前执行线程为:main   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:9
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:8
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:main   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:9
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:8
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:7
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:5
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:9
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:8
当前执行线程为:main   activeCount: 5 - largestPoolSize:5 - queueSize:9
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:7
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:4
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:4
当前执行线程为:main   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:3
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:9
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:8
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 4 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:8
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:9
当前执行线程为:main   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:5
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:4
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:5
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:5
当前执行线程为:main   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:3
当前执行线程为:sync-or-search   activeCount: 4 - largestPoolSize:5 - queueSize:9
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:7
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:8
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:9
当前执行线程为:main   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:7
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:5
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:7
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:main   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:8
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:7
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:5
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:8
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:main   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:8
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:7
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:7
当前执行线程为:main   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:7
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:9
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:8
当前执行线程为:sync-or-search   activeCount: 4 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:9
当前执行线程为:main   activeCount: 5 - largestPoolSize:5 - queueSize:10
当前执行线程为:sync-or-search   activeCount: 4 - largestPoolSize:5 - queueSize:7
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:6
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:7
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:4
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:5
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:4
当前执行线程为:sync-or-search   activeCount: 4 - largestPoolSize:5 - queueSize:3
当前执行线程为:sync-or-search   activeCount: 4 - largestPoolSize:5 - queueSize:1
当前执行线程为:sync-or-search   activeCount: 5 - largestPoolSize:5 - queueSize:0
当前执行线程为:sync-or-search   activeCount: 4 - largestPoolSize:5 - queueSize:1

Process finished with exit code 137 (interrupted by signal 9: SIGKILL)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值