[concurrency-interest] Setting a Thread name in a ThreadPool

David Harrigan dharrigan at gmail.com
Thu Oct 26 08:13:02 EDT 2006


Previously, if I wanted to set a thread name, I could so something like

new Thread(new RunnableTask(), "DoSomethingWonderfulThread").start();

now, if I'm delgating over to an Executors, like
Executors.newCachedThreadPool(), and using that to execute my thread:

ExecutorService s = Executors.newCachedThreadPool();
s.execute(new RunnableTask());

The execute method isn't overloaded to provide a name, so, how do I go about
setting the Thread name? 

View this message in context: http://www.nabble.com/Setting-a-Thread-name-in-a-ThreadPool-tf2513566.html#a7009924
Sent from the JSR166 Concurrency mailing list archive at Nabble.com.

More information about the Concurrency-interest mailing list