You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2010/10/13 20:45:38 UTC

Re: svn commit: r1022205 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPoolFactory.java

On 13 October 2010 18:32,  <si...@apache.org> wrote:
> Author: simonetripodi
> Date: Wed Oct 13 17:32:37 2010
> New Revision: 1022205
>
> URL: http://svn.apache.org/viewvc?rev=1022205&view=rev
> Log:
> fixed deprecated properties direct access
> added missing setters
> syncronized mutable properties (s|g)etters

I think createPool also needs to be synchronised, as it references the
various mutable fields.
Alternatively, could make them all volatile.

Otherwise if one thread sets the value and another calls createPool,
the second thread might not see the latest value.

But perhaps the PoolFactory class does not need to be thread-safe at
all, in which case the synch. can be dropped?

At present it appears to be thread-safe, but it is only conditionally
thread-safe.

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


Re: svn commit: r1022205 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPoolFactory.java

Posted by Simone Tripodi <si...@gmail.com>.
I agree. Maybe we don't need to make *Factory synchronized, but just pool impls.
How does it sound?
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Wed, Oct 13, 2010 at 8:45 PM, sebb <se...@gmail.com> wrote:
> On 13 October 2010 18:32,  <si...@apache.org> wrote:
>> Author: simonetripodi
>> Date: Wed Oct 13 17:32:37 2010
>> New Revision: 1022205
>>
>> URL: http://svn.apache.org/viewvc?rev=1022205&view=rev
>> Log:
>> fixed deprecated properties direct access
>> added missing setters
>> syncronized mutable properties (s|g)etters
>
> I think createPool also needs to be synchronised, as it references the
> various mutable fields.
> Alternatively, could make them all volatile.
>
> Otherwise if one thread sets the value and another calls createPool,
> the second thread might not see the latest value.
>
> But perhaps the PoolFactory class does not need to be thread-safe at
> all, in which case the synch. can be dropped?
>
> At present it appears to be thread-safe, but it is only conditionally
> thread-safe.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

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