new Thread(new Runnable(){
ExecutorService service = Executors.newCachedThreadPool();
public void run() {
System.out.println(Thread.currentThread().getName());
service.submit(new Runnable(){
public void run() {
System.out.println("-----"+Thread.currentThread().getName());
}});
}
}).start();
老师,eventloop也是一个线程池把,我用java的线程池写了个demo 打印结果是 Thread-0 -----pool-1-thread-1 上面您这种执行一个task也是evenloop连接池中执行,按照来说 打印Thread.currentThread也是类似-pool-1-thread-1吧 按照我想的