Abrahim:
How are threads recognized in threadpool ?
I am not sure what do you intend by saying "recognized".
I assume you are talking about the ThreadPool Implementation in the jdk, so, I would answer in terms of ThreadPoolExecutor.
It maintains a HashSet of workers(A runnable implementation) and there is no reference to the Thread created. Workers pull tasks from the work queue and execute them.
There is no managing entity that picks up a thread and instructs to execute a task. So, I dont think anybody needs to recognize any thread as such.
Every thread in the JVM is assigned a unique identifier, so, assigning same name does no harm to the thread execution/management but it will create problems for people debugging the thread dumps.
[ July 23, 2008: Message edited by: Nitesh Kant ]