When I do this
               // Second utilise any spare capacity to create new objects
if ((_maxActive < 0 || pool.activeCount + pool.internalProcessingCount < _maxActive) && (_maxTotal < 0 || _totalActive + _totalIdle + _totalInternalProcessing < _maxTotal)) {
                   // allow new object to be created
                   try {
                   _allocationQueue.removeFirst();
                   } catch (Exception ex) {
                       System.out.println(latch.toString());
                   }

and add a toString for Latch, I get this output with 10 threads going after randomly generated numerical keys between 0 and 19. Note that the config that I posted causes latency to be simulated for factory methods. There are usually 8 of these at the beginning of a run. _mayCreate is always true (does that make sense?), activeCount can be 1, idle count is always 0, internal processing count is always positive (as large as 8) and _pair is always null.

    [java] _mayCreate = true
    [java]  key = 18
    [java]  ObjectTimeStampPair = NULL
    [java]  pool:
    [java]    activeCount = 0
    [java]    idle count = 0
    [java]    internal processing count = 2
    [java]
    [java] _mayCreate = true
    [java]  key = 18
    [java]  ObjectTimeStampPair = NULL
    [java]  pool:
    [java]    activeCount = 0
    [java]    idle count = 0
    [java]    internal processing count = 4
    [java]
    [java] _mayCreate = true
    [java]  key = 14
    [java]  ObjectTimeStampPair = NULL
    [java]  pool:
    [java]    activeCount = 0
    [java]    idle count = 0
    [java]    internal processing count = 1'

Phil


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

Reply via email to