使用ExecutorService来中止线程服务

文章目录 使用shutdown 使用shutdownNow 使用ExecutorService来中止线程服务 以前的文章中咱们提到了ExecutorService能够使用shutdown和shutdownNow来关闭。java 这两种关闭的区别在于各自的安全性和响应性。shutdownNow强行关闭速度更快,可是风险也更大,由于任务可能正在执行的过程当中被结束了。而shutdown正常关闭虽然速度
相关文章
相关标签/搜索