You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by David Clark <pl...@gmail.com> on 2015/07/01 15:39:47 UTC

Memoized AST

Quick question. Is the cache that the Memoized AST creates thread safe?

Re: Memoized AST

Posted by Keegan Witt <ke...@gmail.com>.
I haven't used that annotation personally (so somebody that knows better
can correct me if I'm wrong here), but I think it is.  If you look at the
implementations of org.codehaus.groovy.runtime.memoize.MemoizeCache
(org.codehaus.groovy.runtime.memoize.UnlimitedConcurrentCache and
org.codehaus.groovy.runtime.memoize.LRUCache), they both use synchronized
collections for their caches.

If I'm understanding this correctly, should we maybe mention the fact
@Memoized is thread-safe in its Javadoc?

-Keegan

On Wed, Jul 1, 2015 at 9:39 AM, David Clark <pl...@gmail.com> wrote:

> Quick question. Is the cache that the Memoized AST creates thread safe?
>