In Java, is a Comparator used in Collections.sort() thread safe?
Posted
by evan
on Stack Overflow
See other posts from Stack Overflow
or by evan
Published on 2010-05-21T17:59:42Z
Indexed on
2010/05/21
18:10 UTC
Read the original article
Hit count: 271
If I create a single instance of a Comparator, can that instance be used across multiple threads to sort collections using Collections.sort()? Or, do I need to create a new instance of the Comparator for each call to Collections.sort() to ensure thread safety?
© Stack Overflow or respective owner