|
Phil Steitz made changes - 09/Mar/08 05:19 PM
Take a look at
As an aside, I have a patch for this for GOP and am in the process of porting similar changes to GKOP. Aha. I misunderstood the nature of the problem. I thought it was about two or more factory methods being invoked concurrently on the same pooled object, but it's really about issues that can arise in general if the client-provided object factory is not thread safe. (Right?) I think it's rather accommodating of you to handle it with a code fix. Indeed, I cannot imagine how a comprehensive fix could avoid unnecessarily reducing performance in cases where the object factory in use is already thread safe. I also don't see how Pool can protect against non-thread-safe object factories being used concurrently by the Pool and by another client (which is, in a sense, what happened in
You said you already have a patch for GOP, but are you sure it wouldn't be better to document that users must provide a thread-safe object factory? They can always use one of the PoolUtil.synchronizedPoolableFactory() methods to get one if they need to do, though it would be better to use a factory that does not require synchronization for thread safety.
Mark Thomas made changes - 12/May/09 06:08 PM
Phil Steitz made changes - 19/Jun/09 04:13 PM
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Those scenarios appear to arise from client errors, and they are likely to cause problems even if the concurrency can be prevented. (For example, it may be a problem to invoke destroyObject() twice sequentially with the same argument.) What am I missing here?