Uploaded image for project: 'Commons Pool'
  1. Commons Pool
  2. POOL-75

[pool] GenericObjectPool not FIFO with respect to borrowing threads

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Nightly Builds
    • Fix Version/s: 1.5
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Bugzilla Id:
      39590

      Description

      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.

        Attachments

        1. java4.patch
          13 kB
          Takayuki Kaneko
        2. java3.patch
          12 kB
          Takayuki Kaneko
        3. java2.patch
          11 kB
          Takayuki Kaneko
        4. ctest.fairness.png
          7 kB
          Takayuki Kaneko
        5. ctest.original.png
          16 kB
          Takayuki Kaneko
        6. java.patch
          13 kB
          Takayuki Kaneko

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                gojomo@archive.org Gordon Mohr
              • Votes:
                6 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: