Restricting thread count and Java concurrency

后端 未结 4 517
北海茫月
北海茫月 2021-01-14 06:51

I couldn\'t find an example of this specific case using the latest JAVA concurrent routines.

I plan to use threads to process items from an open queue w

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-14 07:37

    Looks like you need a thread pool executor with corePoolSize=0 and maximumPoolSize=10.

    http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html

提交回复
热议问题