commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Takayuki Kaneko (JIRA)" <j...@apache.org>
Subject [jira] Updated: (POOL-75) [pool] GenericObjectPool not FIFO with respect to borrowing threads
Date Sun, 24 Feb 2008 16:31:14 GMT

     [ https://issues.apache.org/jira/browse/POOL-75?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Takayuki Kaneko updated POOL-75:
--------------------------------

    Attachment: java3.patch

Hi Phil,

Thanks for pointing out my patch's problems.

1) I'm trying to fix the issue on unit cases. I fixed some issue so I attach a new patch.
I wonder about TestGenericObjectPool#checkEvictorVisiting method. At line 335, pool's _numActive
is greater than _maxActive because objects were already borrowed at line 294.
Is this a correct behavior?

2) "depth" is used to implement reentrant locking. Reentrant locking is popular feature
on lock algorithm.
But I had another think coming, in GenericObjectPool it is unnecessary feature.

3) Yeah, I accept this patch applies APL.

Please let me know about 1).
I will work more on this issue because fairness is really useful on enterprise use!

Regards,

> [pool] GenericObjectPool not FIFO with respect to borrowing threads
> -------------------------------------------------------------------
>
>                 Key: POOL-75
>                 URL: https://issues.apache.org/jira/browse/POOL-75
>             Project: Commons Pool
>          Issue Type: Improvement
>    Affects Versions: Nightly Builds
>         Environment: Operating System: All
> Platform: All
>            Reporter: Gordon Mohr
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: ctest.fairness.png, ctest.original.png, java.patch, java2.patch,
java3.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message