Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: To Experienced Java Programmers: strange BUG!!

Author: Bernd Nürnberger

Date: 05:55:01 05/06/04

Go up one level in this thread


On May 06, 2004 at 08:34:13, Thorsten Greiner wrote:

>On May 06, 2004 at 07:07:57, Bernd Nürnberger wrote:
>
>>Could it be, that some operators in Java on long values are not properly
>>implemented and make errors on certain circumstances? Maybe a set upper
>>bit (64th bit, sign bit) causes problems in some cases?
>
>I have implemented a Java version of my bitboard engine Amy and have never
>experienced any problem like the one you describe. The chances are very high
>that the bug is in your code and not in the JVM :)
>
>There is one thing that comes to my mind that might be related to your problem:
>in Java the access of 64 bit quantities is a non-atomic operation. If your
>application is multithreaded this might cause data corruption as you describe.

I have two threads: one reading and processing input and the "main"
thread for the engine. But the variable in question is a local variable,
and moreover the different threads use different instances of the classes
in question.

Could your issue nethertheless apply in this case?  Maybe the internal
splitting in two 32 bit vars, operation on these, and "concanting" them
back to a 64 bit value are interrupted by the other thread, causing
the CPU registers to hold false values?  But in case your issue is a
problem in my case: how to fix it?

Thanks for your answer and greets,

Bernd




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.