#1069: Replaced SimpleScheduler with SimpleTimer2 in a few places

This commit is contained in:
dev
2015-04-15 15:32:40 +00:00
parent dc19d2fab3
commit 54dba980b4
11 changed files with 10 additions and 18 deletions

View File

@@ -82,7 +82,7 @@ class PeerManager {
_peersByCapability.put(Character.valueOf(Character.toLowerCase(TRACKED_CAPS.charAt(i))), new ConcurrentHashSet<Hash>());
loadProfilesInBackground();
////_context.jobQueue().addJob(new EvaluateProfilesJob(_context));
//SimpleScheduler.getInstance().addPeriodicEvent(new Reorg(), 0, REORGANIZE_TIME);
//SimpleTimer2.getInstance().addPeriodicEvent(new Reorg(), 0, REORGANIZE_TIME);
//new Reorg();
//_context.jobQueue().addJob(new PersistProfilesJob(_context, this));
}

View File

@@ -127,7 +127,7 @@ class UDPReceiver {
long delay = ARTIFICIAL_DELAY_BASE + _context.random().nextInt(ARTIFICIAL_DELAY);
if (_log.shouldLog(Log.INFO))
_log.info("Delay packet " + packet + " for " + delay);
SimpleScheduler.getInstance().addEvent(new ArtificiallyDelayedReceive(packet), delay);
SimpleTimer2.getInstance().addEvent(new ArtificiallyDelayedReceive(packet), delay);
return -1;
}
**********/

View File

@@ -28,13 +28,13 @@ import net.i2p.util.Log;
*
* If the ArrayWrapper object in the HashSet is 50 bytes, and BloomSHA1(23, 11) is 1MB,
* then for less than 20K entries this is smaller.
* And this uses space proportional to traffiic, so it doesn't penalize small routers
* And this uses space proportional to traffic, so it doesn't penalize small routers
* with a fixed 8MB.
* So let's try it for the first 2 or 3, for now.
*
* Also, DBF is syncrhonized, and uses SimpleTimer.
* Also, DBF is synchronized, and uses SimpleTimer.
* Here we use a read/write lock, with synchronization only
* when switching double buffers, and we use SimpleScheduler.
* when switching double buffers, and we use SimpleTimer2.
*
* Yes, we could stare at stats all day, and try to calculate an acceptable
* false-positive rate for each of the above uses, then estimate the DBF size