Other types of concurrent programming

First, understand CompletionService

CompletionService integrated Executor and BlockingQueue functions.

You can submit Callable tasks to it to perform in the queue and take similar poll method is then used to obtain the results when complete results are available as a packaged Future. ExecutorCompletionService CompletionService is a class that implements the interface, and delegate tasks to calculate a Executor.

Guess you like

Origin www.cnblogs.com/lys-lyy/p/11105236.html