Issue Details (XML | Word | Printable)

Key: POOL-75
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Gordon Mohr
Votes: 6
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Commons Pool

[pool] GenericObjectPool not FIFO with respect to borrowing threads

Created: 16/May/06 07:42 AM   Updated: 17/May/09 11:23 PM
Return to search
Component/s: None
Affects Version/s: Nightly Builds
Fix Version/s: 1.5

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works java.patch 2007-12-25 11:08 AM Takayuki Kaneko 13 kB
Text File Licensed for inclusion in ASF works java2.patch 2008-02-07 02:50 AM Takayuki Kaneko 11 kB
Text File Licensed for inclusion in ASF works java3.patch 2008-02-24 04:29 PM Takayuki Kaneko 12 kB
Text File Licensed for inclusion in ASF works java4.patch 2008-04-02 06:39 AM Takayuki Kaneko 13 kB
Image Attachments:

1. ctest.fairness.png
(7 kB)

2. ctest.original.png
(16 kB)
Environment:
Operating System: All
Platform: All
Issue Links:
Blocker
 

Bugzilla Id: 39590
Resolution Date: 17/May/09 11:23 PM


 Description  « Hide
GenericObjectPool has recently been made FIFO with respect to the managed pool
objects – however, it is still not FIFO with respect to threads requesting
those objects. Specifically, because standard non-fair Java synchronization
monitors are used, later threads may barge ahead of earlier threads that are
already waiting for a pool object to become available. At its extreme, some
threads can cycle objects through the pool many times while others wait
interminable.

Not every application needs FIFO fairness with respect to threads, and such
fairness implies an overhead, so it need not be the default behavior, but it
would be a valuable option where many threads are sharing a smaller number of
pool objects.

I can submit a FairGenericObjectPool which achieves thread-fairness; it only
requires small changes to GenericObjectPool which allow some subclass overriding.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #775700 Sun May 17 16:35:24 UTC 2009 markt Add test case for POOL-75
Files Changed
MODIFY /commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java

Repository Revision Date User Message
ASF #775707 Sun May 17 16:42:34 UTC 2009 markt Fix POOL-75 for GOP. Ensure objects are allocated in the order in which threads ask for them.
Files Changed
MODIFY /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java

Repository Revision Date User Message
ASF #775773 Sun May 17 22:49:07 UTC 2009 markt Modify test to include additional check. Identifies bug in fix for POOL-75.
Files Changed
MODIFY /commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java

Repository Revision Date User Message
ASF #775774 Sun May 17 22:49:50 UTC 2009 markt Correct bug in patch for POOL-75. If allocation fails, latch should be removed from allocation queue.
Files Changed
MODIFY /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java

Repository Revision Date User Message
ASF #775775 Sun May 17 22:58:25 UTC 2009 markt Fix POOL-75 for GKOP. Objects are now allocated to threads in the order in which the threads made their request.
Files Changed
MODIFY /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java