commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject Re: [pool] Pool config vs. factory hierarchies.
Date Fri, 29 Oct 2010 18:24:29 GMT
On 29 October 2010 18:51, James Carman <> wrote:
> On Fri, Oct 29, 2010 at 12:48 PM, sebb <> 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:
> For additional commands, e-mail:

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

View raw message