Re: [freenet-dev] [freenet-cvs] r19754 - trunk/freenet/src/f…

Top Page
Author: Matthew Toseland
Date:  
To: devl
Subject: Re: [freenet-dev] [freenet-cvs] r19754 - trunk/freenet/src/freenet/client
Delete this message
Reply to this message
gpg: Signature made Tue May 6 00:37:16 2008 UTC using DSA key ID E43DA450
gpg: Good signature from "Matthew John Toseland <toad@amphibian.dyndns.org>"
On Monday 05 May 2008 13:11, j16sdiz@??? wrote:
> Author: j16sdiz
> Date: 2008-05-05 12:11:06 +0000 (Mon, 05 May 2008)
> New Revision: 19754
>
> Modified:
> trunk/freenet/src/freenet/client/FECCodec.java
> Log:
> don't use lastPolledMaxRunningFECThreads (it didn't work anyway)


Can't it be fixed? If we're running in a VM then the number of CPUs can change
at run time.
>
> Modified: trunk/freenet/src/freenet/client/FECCodec.java
> ===================================================================
> --- trunk/freenet/src/freenet/client/FECCodec.java    2008-05-05 12:10:41 UTC

(rev 19753)
> +++ trunk/freenet/src/freenet/client/FECCodec.java    2008-05-05 12:11:06 UTC

(rev 19754)
> @@ -357,8 +357,8 @@
>     private static int fecPoolCounter;
>     
>     private synchronized static int getMaxRunningFECThreads() {
> -        long now = System.currentTimeMillis();
> -        if(now - lastPolledMaxRunningFECThreads < 5*60*1000) return

maxRunningFECThreads;
> +        if (maxRunningFECThreads != -1)
> +            return maxRunningFECThreads;
>         String osName = System.getProperty("os.name");
>         if(osName.indexOf("Windows") == -1 && (osName.toLowerCase().indexOf("mac

os x") > 0) || (!NativeThread.usingNativeCode())) {
>             // OS/X niceness is really weak, so we don't want any more background

CPU load than necessary
> @@ -383,11 +383,7 @@
>         return maxRunningFECThreads;
>     }
>     
> -    private static int maxRunningFECThreads;
> -    private static int lastPolledMaxRunningFECThreads = -1;
> -    static {
> -        getMaxRunningFECThreads();
> -    }
> +    private static int maxRunningFECThreads = -1;
>
>     /**
>      * A private Thread started by {@link FECCodec}...
>
> _______________________________________________
> cvs mailing list
> cvs@???
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
>
>