On Monday 05 May 2008 13:11, j16sdiz at freenetproject.org 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 at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20080506/302f6ab7/attachment.pgp>

Reply via email to