[stringtemplate-interest] thread safety

Jonathan Buhacoff jonathan at buhacoff.net
Thu Nov 12 20:01:07 PST 2009


I don't see myself ever sharing a template object among multiple  
threads. I'm not sure I'd even be interested in sharing renderers  
because different threads might want different output.


On Nov 12, 2009, at 4:16 PM, Terence Parr wrote:

> so, currently in ST v3, only renderer tracking is thread safe:
>
>     public void registerRenderer(Class attributeClassType,
> AttributeRenderer renderer) {
>         if ( attributeRenderers==null ) {
>             attributeRenderers = Collections.synchronizedMap(new
> HashMap<Class,AttributeRenderer>());
>         }
>         attributeRenderers.put(attributeClassType, renderer);
>     }
>
> All the other stuff isn't; not even adding attributes. the question
> is: what should be thread safe. seems weird to have multiple threads
> update a single template or group, but...thought i would ask.
>
> Ter
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest



More information about the stringtemplate-interest mailing list