1.CPU密集型:几核CPU,最大线程数就是几。 获取本机核数: Runtime.getRuntime().availableProcessors() 2.IO密集型:最大线程数>程序中十分耗IO的线程数