cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giacomo <>
Subject Re: AW: [C2] ThreadSafe Interface
Date Mon, 16 Jul 2001 05:11:11 GMT
On Sun, 15 Jul 2001, Gerhard Froehlich wrote:

> >> Hi,
> >> some questions to the ThreadSafe interface:
> >>
> >> 1.Could somebody explain in few words what this ThreadSafe
> >> Interface is doing?
> >> Because the avalon api description is not really helpfull!
> >The Avalon ComponentManager will share a single instance of this
> >Component across requestors. It's something like producing a Singleton
> >within the Avalon component managerment system.
> Ok I understand. There is only one instance of the class in a "pool".

There is not pool needed.

> When
> requesting (thread, something else) for this class, the manager lock this
> instance and only the calling thread can use it. Others have to wait.

No, no. All requesting threads get the very same instance.

> Cool. That means public methods which are accessed by requestors must not be
> synchronized, or?
> But when I start an inner thread, which calls a private method in
> this class, this method should be synchronized if needed. Do I have the
> right
> approach?

No, you don't. A ThreadSafe component should be code that is
known as "reentrant" code.


To unsubscribe, e-mail:
For additional commands, email:

View raw message