Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Robbie Brown Newsgroups: comp.lang.java.programmer Subject: Re: VERY PECULIAR PROBLEM Date: Fri, 13 Mar 2015 10:12:43 +0000 Organization: A noiseless patient Spider Lines: 22 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 13 Mar 2015 10:11:57 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="6f44738199d8e778bc2b1b43708fc87f"; logging-data="2198"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++UIalGrSyhcm7K09JvLiIxZ2+2qAxcPE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 In-Reply-To: Cancel-Lock: sha1:K6YNk9E3hBnKjmI4iPcc9qjFLmg= Xref: csiph.com comp.lang.java.programmer:31319 On 13/03/15 09:36, Nigel Wade wrote: > My guess, and it has to be a guess because of the total lack of > information as others have highlighted, is that your code (the *other* > code, which you don't show) "doesn't count time" because it's running in > another thread which isn't synchronized properly. The code you've shown > is a tight, CPU bound, loop so I guess the other thread is starved of > CPU cycles. Add your System.out and the tight loop becomes I/O bound, > allowing the other thread to gain CPU cycles. > > All complete conjecture based on a complete lack of information. This sounds highly plausible. I'll probably get shouted at for suggesting this but WTF. OP why don't you paste-bin your code and let the boffins (and us that are less than perfect) have a look. Just a suggestion -- Not floundering ... just fishing