1 Reply Latest reply on Dec 2, 2004 6:48 AM by belaban

    Unsynchronized HashMap hangs

    tmessu

      We have (quite) random hangs in TreeCache.

      TreeCache.getGlobalTransactionFromThread calls thread2GtxMap_.get(..)
      which never returns. Using JDB and reading java.util.HashMap sources
      it seems that we have a never ending loop of entries in the maps
      index table. The only reason I could figure out is that HashMap, being
      unsynchronized, is skrewed up by multiple simultaneous puts by
      getGlobalTransactionFromThread.

      Is there any reason why unsynchronized Map is used for thread2GtxMap_
      and is there some other kind of synchronization protection that
      is not apparent from TreeCache.java itself?

        • 1. Unsynchronized HashMap hangs
          belaban

          We have (quite) random hangs in TreeCache.

          TreeCache.getGlobalTransactionFromThread calls thread2GtxMap_.get(..)
          which never returns. Using JDB and reading java.util.HashMap sources
          it seems that we have a never ending loop of entries in the maps
          index table. The only reason I could figure out is that HashMap, being
          unsynchronized, is skrewed up by multiple simultaneous puts by
          getGlobalTransactionFromThread.

          Is there any reason why unsynchronized Map is used for thread2GtxMap_
          and is there some other kind of synchronization protection that
          is not apparent from TreeCache.java itself?