Nice! More below... --- James Strachan <[EMAIL PROTECTED]> wrote: > From: "Morgan Delagrange" <[EMAIL PROTECTED]> > > Are compiled Script objects supposed to be > > thread-safe, or do I need to pool them? In either > > case, the answer should probably be documented in > the > > Javadocs. > > Scripts are *meant* to be thread safe. So each Tag > is thread local so that > the same Script can be run concurrently in several > threads.
And new Tag are instantiated with every parse performed by a given thread? There is no danger of a Tag carrying over state from parse to parse, or is there? I hope not; clearing out state was always a big pain in taglibs, particularly since the spec has always worded the taglib lifecycle very poorly. > Note though that > the parsing of Scripts isn't thread safe; so only 1 > thread should parse a > Script at once (so the XMLParser could be > synchronized or pooled). Or you could use a fresh XMLParser every time, if you have a limited number of scripts to parse, right? I'm assuming that two instances of XMLParser can parse concurrently with no trouble. > However > once you have a Script you should be able to run it > in several threads. That's good to know. I wanted to prevent reading those > The JellyContext should be thread local; the aim is > to refactor the > JellyContext code a little so that it supports > pluggable variable Scopes, > then some synchronized shared Scopes can be used to > share state across > threads, while still having thread local Scopes too. That's what I assumed, cool. > The org.apache.commons.jelly.impl package contains > the Script implementation > classes, *Script.java, which should be thread safe. So, what's the plan here? That any implementation of Script should be thread-safe? If so, that should probably be noted in the Javadocs somewhere. If not, perhaps you should add a method like isThreadSafe() to the Script interface, so clients know whether or not they can hold onto compiled Scripts. > Though I think > BeanTagScript might not be threadsafe right now, it > might need a couple of > tweeks to ensure thread safety. FWIW I've been > meaning to simplify the code > in this part so that BeanTagScript, TagScript and > DynaTagScript merge > together into a single class capable of invoking at > runtime either a bean > Tag or a DynaTag and being thread safe) > > James > ------- > http://radio.weblogs.com/0112098/ > > __________________________________________________ > Do You Yahoo!? > Everything you'll ever need on one web page > from News and Sport to Email and Music Charts > http://uk.my.yahoo.com > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > ===== Morgan Delagrange http://jakarta.apache.org/taglibs http://jakarta.apache.org/commons http://axion.tigris.org http://jakarta.apache.org/watchdog __________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>