cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: C2 thread savety
Date Mon, 24 Jul 2000 03:48:22 GMT
On Sun, 23 Jul 2000, Stefano Mazzocchi wrote:

> Donald Ball wrote:
> > 
> > On Sun, 23 Jul 2000, Giacomo Pati wrote:
> > 
> > > I've encountered a problem concerning thread savetyness. The old C2
> > > sitemap engine instantiated a component object (generator, serializer,
> > > etc.) for every request. The new sitemap engine does not. Now we should
> > > decide if a sitemap component should be thread save, or not or if we
> > > could have a mixture of both (indicated in the sitemap as an attribute
> > > like thread-save="yes").
> > 
> > the mixture idea strikes me as a good one. thread-safe components could
> > exist as singletons, while non-thread-safe components could either be
> > created on the fly for each request or pooled and reused.
> 
> This is good only as long as the sitemap doesn't have this notion.
> 
> How about creating an empty interface "ThreadSafeComponent" interface
> that you implement if your component is thread safe?
> 
>  public interface ThreadUnsafeComponent extends Component, Recyclable {
>   //nothing to add, it just signals a specific aspect of the Component
>  }
> 
> Then we could use my good-old jserv recycleable code for pooling (which
> should be packaged under Avalon)

works for me. are you gonna package up your pooling stuff for avalon?

- donald


Mime
View raw message