gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnugo-devel] Re: Crash


From: Teun Burgers
Subject: [gnugo-devel] Re: Crash
Date: Sat, 11 May 2002 12:32:04 +0200

Gunnar Farneback wrote:

> It seems like bad data is obtained from the (non-persistent) reading
> cache. I'm not sure whether this also indicates some subtler problem,
> but the main problem is that reset_engine() is never run between the
> undo command and the examine_position() call in the estimate_score
> command. The appended patch stops the crash.
> 
> It is clear that the use of reset_engine() currently is too fragile.
> We need to robustify this somehow.

I think part of the problem is that Gnu Go makes extensive use of global
variables.
It is completely unclear from a function call such as reset_engine()
which
datastructures and variables are affected. You have to consult the
source
for that. I think it would be better to pass more information by
arguments.

I've had a similar experience with a simulation program I wrote for
work.
Once I eliminated the globals, the dataflow becomes much more clear and
reusability and maintainability of the code improve. Looking into the
future, things such as multi-threading would also be easier without
the globals.

Teun



reply via email to

[Prev in Thread] Current Thread [Next in Thread]