Changeset dfbbe3e


Ignore:
Timestamp:
Dec 1, 2015 8:09:22 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
72527f4
Parents:
f778c23f
Message:

Transport: Interrupt DH refiller thread when pool is empty,
to speed refilling and reduce pumper stalls
Reduces empties by 10x

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/crypto/DHSessionKeyBuilder.java

    rf778c23f rdfbbe3e  
    506506                        long curCalc = System.currentTimeMillis() - curStart;
    507507                        // for some relief...
    508                         try {
    509                             Thread.sleep(Math.min(200, Math.max(10, _calcDelay + (curCalc * 3))));
    510                         } catch (InterruptedException ie) { // nop
     508                        if (!interrupted()) {
     509                            try {
     510                                Thread.sleep(Math.min(200, Math.max(10, _calcDelay + (curCalc * 3))));
     511                            } catch (InterruptedException ie) {}
    511512                        }
    512513                    }
     
    542543                _context.statManager().addRateData("crypto.DHEmpty", 1);
    543544                builder = precalc();
     545                // stop sleeping, wake up, make some more
     546                this.interrupt();
    544547            }
    545548            return builder;
Note: See TracChangeset for help on using the changeset viewer.