Hi all, I am trying to keep set of values in the hashmap for each of the generated thread. I am planning to use name of the thread as a key in the hashmap and value will be some object. Is it possible that the 2 threads can have the same name ? If yes , then what could be the way by which I can identify 2 threads uniquely. Thanks in advance Samir
What you are trying to do is already available via ThreadLocals
As for your question about thread names, if you are not explicitly setting the name then every thread will have a unique name. If you are setting it explicitly to the same name, i am not sure what happens.