On Fri, Oct 29, 2010 at 11:40 AM, sebb <seb...@gmail.com> wrote:
>
> If Config instances are immutable, then there is no need to synch.
> access to their contents.
> However, if the field which stores the Config instance is not final,
> then all accesses to that need to be synch. - or the field could be
> volatile.
>
> Once the code has obtained the config pointer safely, it can access
> the final Config fields without synch. This would eliminate the need
> for the locks, provided that the config instance was fetched at most
> once per operation.
>

If the only place where that field can change is in the reconfigure()
method, then you can use the read/write lock to handle your
synchronization.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to