What are the advantages of using an ExecutorService?
问题 What is the advantage of using ExecutorService over running threads passing a Runnable into the Thread constructor? 回答1: ExecutorService abstracts away many of the complexities associated with the lower-level abstractions like raw Thread . It provides mechanisms for safely starting, closing down, submitting, executing, and blocking on the successful or abrupt termination of tasks (expressed as Runnable or Callable ). From JCiP, Section 6.2, straight from the horse's mouth: Executor may be a