Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 10969 invoked by uid 500); 2 Jun 2003 11:55:40 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 10953 invoked from network); 2 Jun 2003 11:55:40 -0000 Received: from pop018pub.verizon.net (HELO pop018.verizon.net) (206.46.170.212) by daedalus.apache.org with SMTP; 2 Jun 2003 11:55:40 -0000 Received: from verizon.net ([141.156.169.148]) by pop018.verizon.net (InterMail vM.5.01.05.33 201-253-122-126-133-20030313) with ESMTP id <20030602115540.THEJ11703.pop018.verizon.net@verizon.net> for ; Mon, 2 Jun 2003 06:55:40 -0500 Message-ID: <3EDB3B3B.9020706@verizon.net> Date: Mon, 02 Jun 2003 07:55:39 -0400 From: Vadim Gritsenko User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: cocoon-dev@xml.apache.org Subject: Re: FragmentExtractor getting and releasing Store every time? References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at pop018.verizon.net from [141.156.169.148] at Mon, 2 Jun 2003 06:55:40 -0500 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Carsten Ziegeler wrote: >Torsten Knodt wrote: > > >>On Sunday 01 June 2003 15:51, Carsten Ziegeler wrote: >>CZ> The safest way is to lookup/release a component every time you >>CZ> need it, so the fragmentextractor uses the "correct" approach. >>CZ> If you know that the component you want to use is ThreadSafe >>CZ> and will always be ThreadSafe than you can optimize your code >>CZ> and lookup the component only once - this optimization has been >>CZ> done in the xslttransformer. >>XSLTProcessorImpl uses Store.TRANSIENT_STORE, like the >>FragmentExtractor. I >>haven't mentioned this explicitly. >>I have looked into the interfaces, and when I understand right, I >>had to look, >>if store implements ThreadSafe. Store doesn't implement >>ThreadSafe, but the >>MRUMemoryStore, which is used as default in cocoon. So I'd say >>it's a bug in >>XSLTProcessorImpl. Agreed? >> No. >>What I would do, is asking in avalon-users for >>changing XSLTProcessorImpl and perhaps others or to have Store implement >>ThreadSafe. But I guess, Store is already released. >> >> > >We have to distinguish between the component (it's interface) and the >implementation. The interface should never expose details about the >implementation, so an implementation detail like ThreadSafe etc. is >not part of the interface which in this case is Store. > >However, the implementation "decides" if it is thread safe, poolable >or whatever. > >Now, the optimization I was refering to can only take place *if* you >know which implementation for a component is really used and *if* >this specific implementation is ThreadSafe. This is a dangerous >assumption! If you assume a component is implemented in a thread safe >manner and this changes sometime and you don't reflect these changes >than you will quickly result in threading problems. > Not in this case though. I think you forgot that XSLTProcessor is Recyclable, and not ThreadSafe. Vadim