cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: C2 thread savety
Date Sun, 23 Jul 2000 21:50:06 GMT
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)

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Mime
View raw message