* Matthew Toseland <t...@amphibian.dyndns.org> [2009-02-25 17:59:32]:

> On Wednesday 25 February 2009 10:00:22 Florent Daigniere wrote:
> > Matthew Toseland wrote:
> > > On Tuesday 03 February 2009 11:36:01 nextg...@freenetproject.org wrote:
> > >> Author: nextgens
> > >> Date: 2009-02-03 11:36:00 +0000 (Tue, 03 Feb 2009)
> > >> New Revision: 25484
> > >>
> > >> Modified:
> > >>    trunk/freenet/src/freenet/node/NodePinger.java
> > >> Log:
> > >> Improve NodePinger:
> > >>
> > >> -take care of synchronization
> > >> -requeue before we do anything so that we are closer to a 200ms period
> > >> -logging optimizations
> > >>
> > >> @@ -24,35 +37,34 @@
> > >>                  run();
> > >>          }
> > >>          
> > >> -        final Node node;
> > >> -        
> > >>          public void run() {
> > >> -            //freenet.support.OSThread.RealOSThread.logPID(this);
> > >> -                try {
> > >> -                        recalculateMean(node.peers.connectedPeers);
> > >> -                } finally {
> > >> -                        node.ps.queueTimedJob(this, 200);
> > >> -                }
> > >> +        // Requeue *before* so that it's accurate in any case
> > >> +        node.ps.queueTimedJob(this, 200);
> > > 
> > > Is this really a good idea? If there is heavy load, you could end up with 
> > > hundreds of these jobs running in parallel?
> > > 
> > 
> > In that case we are screwed anyway; Introduce a "fast-fail" using a 
> > volatile boolean if you think it's worth it.
> 
> What is the purpose of the 200ms period?

Good question; that's your code ;)

I think we use the meanPingTime of connected peers in the load-balancing
algorithm... It does make sense to have "consistent" values.

I guess that 200ms is just an arbitrarily chosen value.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to