1 Aug 2006 05:17
Re: Re: [freenet-cvs] r9809 - trunk/freenet/src/freenet/clients/http
On Sunday 30 July 2006 15:42, David Sowder (Zothar) wrote: > Perhaps it's a lot more work and harder to do, but I think it would > be much better to fix the corner cases with the Hashmaps used by > node.getPeerNodeStatusSize() rather than calculating it for every > /darknet/ page load. Part of the idea of > node.getPeerNodeStatusSize() was for the information to be both > accurate and available to other parts of the node at near zero CPU > cost. Uhm, I'm not sure I completely understand what you mean but iterating once (!) over an array of 5 to 50 PeerNode objects and calling a method that simply returns an int (which most probably gets inlined anyway) is something I do consider "near zero CPU cost." The problem with node.getPeerNodeStatusSize() is that state information for a PeerNode can change during the point getPeerNodeStatusSize() is called and the PeerNode's status itself is shown on the page. To fix that you'd either have to synchronized Node externally (which is a _very_ bad idea) or you'd have to return a list of shallow PeerNode copies that don't change their state after returning them. David
_______________________________________________ Devl mailing list Devl@... http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
RSS Feed