2 Replies Latest reply on Sep 13, 2012 4:25 PM by Clebert Suconic

    ConcurrentHashSet vs newSetFromMap

    nimo stephan Master

      What is the difference of using this:

       

      org.hornetq.utils.ConcurrentHashSet

       

      {code}

      private Set<Object> threadSafe= new ConcurrentHashSet<Object>();

      {code}

      and this:

       

      java.util.Collections.newSetFromMap

       

      {code}

      private Set<Object> threadSafe=  Collections.newSetFromMap(new ConcurrentHashMap<Object, Boolean>());

      {code}