On Mon, Nov 16, 2009 at 3:10 PM, Amit Manjhi <amitman...@google.com> wrote:
> use ConcurrentHashMap? Can avoid the lock. >>> >> >> I don't believe so, as you have to hold the lock across >> containsKey/get/put. >> >> > Wouldn't putIfAbsent(..) work? > Since gets never block, it seems like this can't be used to ensure that all threads come up with the same GwtLocale instance for a given locale. The current implementation seems clearly correct, and the fact that we are having this discussion indicates using ConcurrentHashMap is not a clear win, especially given the time constraints. -- John A. Tamplin Software Engineer (GWT), Google -- http://groups.google.com/group/Google-Web-Toolkit-Contributors