Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 97218 invoked from network); 3 Oct 2002 18:16:19 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 3 Oct 2002 18:16:19 -0000 Received: (qmail 18850 invoked by uid 97); 3 Oct 2002 18:16:00 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 18684 invoked by uid 97); 3 Oct 2002 18:15:58 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 18603 invoked by uid 98); 3 Oct 2002 18:15:57 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <051e01c26b08$c6e45b80$9865fea9@spiritsoft.com> From: "James Strachan" To: "Jakarta Commons Developers List" , References: <20021001193749.11552.qmail@web12403.mail.yahoo.com> <047201c269dd$5a34bdd0$9865fea9@spiritsoft.com> Subject: Re: [Jelly] Are Script objects supposed to be thread-safe? Date: Thu, 3 Oct 2002 19:14:41 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N From: "James Strachan" > From: "Morgan Delagrange" > > 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. 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). However > once you have a Script you should be able to run it in several threads. > > 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. > > The org.apache.commons.jelly.impl package contains the Script implementation > classes, *Script.java, which should be thread safe. 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) I've completed the work in this area now. The old TagScript, BeanTagScript and DynaTagScript have now rolled together into a single TagScript implementation. (This makes life much easier as a Tag at request time could dynamically resolve to a Tag bean or a DyanTag). Also the old non-threadsafe BeanTagScript is no more. So AFAIK the Scripts are all thread safe; there's only a few of them left now which should help ensure that thread-safety is preserved. 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: For additional commands, e-mail: