2 回答
TA贡献1804条经验 获得超2个赞
它很可能是由 custom 生成的线程 id ThreadFactory,就像:
Executor executor = Executors.newFixedThreadPool(4, new ThreadFactory() {
AtomicInteger threadId = new AtomicInteger(0);
@Override
public Thread newThread(Runnable r) {
return new Thread(r, "http-bio-8080-exec-" + threadId.getAndIncrement()); // custom a thread factory
}
});
IntStream.range(0, 10).forEach(value -> {
executor.execute(() -> {
System.out.println(Thread.currentThread().getName()); // print thread name
try {
Thread.sleep(100);
} catch (Exception e) {
}
});
});
输出:
http-bio-8080-exec-0
http-bio-8080-exec-1
http-bio-8080-exec-2
http-bio-8080-exec-3
http-bio-8080-exec-0
http-bio-8080-exec-3
http-bio-8080-exec-1
http-bio-8080-exec-2
http-bio-8080-exec-0
http-bio-8080-exec-3
TA贡献1820条经验 获得超9个赞
那是tomcat中一个线程池生成的线程ID号。真正的问题是不同的,这是一个内部信息,它的价值是什么,现在你知道了吗?我假设接近于零......
添加回答
举报