Dynamic resizing of java.util.concurrent.ThreadPoolExecutor while it has waiting tasks

前端 未结 5 473
走了就别回头了
走了就别回头了 2020-12-05 08:02

I\'m working with a java.util.concurrent.ThreadPoolExecutor to process a number of items in parallel. Although the threading itself works fine, at times we\'ve

5条回答
  •  醉梦人生
    2020-12-05 08:40

    I read the documentation of setMaximumPoolSize() and setCorePoolSize(), and it seems like they can produce the behavior you need.

    -- EDIT --

    My conclusion was wrong: please see the discussion below for details...

提交回复
热议问题