On 29 October 2010 18:51, James Carman <ja...@carmanconsulting.com> wrote: > On Fri, Oct 29, 2010 at 12:48 PM, sebb <seb...@gmail.com> wrote: >> >> Yes, but the code will still need to use the read lock whenever it >> reads the field to ensure changes are propagated correctly. >> Both the writer and reader threads need to synch. on the same lock in >> order for changes to be published safely. >> >> Not sure using a read/write lock would gain anything over using >> volatile - which has the advantage that one cannot bypass it. >> > > I'm not so concerned with access to the variable itself really. I'm > more concerned with a client trying to borrow/return an object while > the pool is in the middle of reconfiguring itself.
I had overlooked that aspect ... If some changes are more expensive to perform, then the method might want to determine which items have changed, rather than just reconfiguring everything. There may be some changes that don't require a pool update. Factory reconfig probably just needs to update the stored config variable, which can be volatile. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org