[concurrency-interest] Target CPU utilization

Joe Bowbeer joe.bowbeer at gmail.com
Fri Feb 16 13:51:35 EST 2007


On 2/16/07, Peter Kovacs <peter.kovacs.1.0rc at gmail.com> wrote:
>
> What if an Executor is not sufficient and I need at least an
> ExecutorService? The edu.emory.mathcs.backport.java.util.concurrent
> does not seem to provide an obvious way to wrapping up an Executor
> instance into an ExecutorService.
>
> I would expect an ExecutorServices to be there for wrapping up
> Executor instances into ExecutorService instances. Does this make
> sense or is there a good reason for the lack of this kind of
> functionality?
>

AbstractExecutorService can wrap an Executor.  It implements
everything but the execute method.  (This needs to be spelled out in
the javadoc.)

http://java.sun.com/javase/6/docs/api/java/util/concurrent/AbstractExecutorService.html

Concerning which type is best for your library to require, Executor is
the easiest to provide (it is the lowest common denominator).  In
addition, ExecutorService exposes shutdown methods that your clients
may not wish to provide to everyone.


More information about the Concurrency-interest mailing list