[concurrency-interest] Target CPU utilization

Peter Kovacs peter.kovacs.1.0rc at gmail.com
Fri Feb 16 13:51:58 EST 2007


On 2/16/07, Tim Peierls <tim at peierls.net> wrote:
> 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.
> >
>
> You can use AbstractExecutorService to create a wrapper around other
> Executors and ExecutorServices.

I thought of this...the obvious way would be to subclass
AbstractExecutorService and override the Executor.execute method by
delegating to the wrapped custom Executor instance. But for this to
work, all relevant methods in AbstractExecutorService (the submit and
invokeXXX methods in particular) should ultimately call
AbstractExecutorService's own published execute method, which is not
necessarily the case. It is possible that the submit and invokeXXX
methods of AbstractExecutorService directly call the execute method of
a contained (default) Executor instance -- and I found nothing in the
API doc which would encourage me to think the contrary.

Thanks
Peter
>
> --tim
>


More information about the Concurrency-interest mailing list