Is ThreadPoolExecutor parallel or concurrent

is ThreadPoolExecutor parallel or concurrent? how to achieve parallelism?

Aug.25,2021

  • concurrency: the ability to handle multiple tasks at the same time, but not necessarily at the same time
  • parallel: the ability to handle multiple tasks at the same time

for users, its external performance is generally concurrent, but it is also possible that multiple tasks are assigned to multiple CPU cores, that is, multiple tasks may be executed in parallel, depending on the allocation strategy of the operating system time slice and the idle situation of the CPU core. ThreadPoolExecutor will squeeze CPU resources as much as possible to avoid wasting resources.

Menu