Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: longjmp question

Author: Ross Boyd

Date: 15:59:30 06/20/04

Go up one level in this thread


On June 20, 2004 at 12:31:12, Robert Hyatt wrote:

>On June 20, 2004 at 06:00:58, Ross Boyd wrote:
>
>>My engine (coded in C) uses longjmp() to terminate a search.
>>
>>Is there any disadvantage or hidden overhead in this approach?
>
>1.  No threads.  Hence no parallel search.

That's a very good reason for not using it. (I mean longjmp(), not parallel
search. :)

>2.  Ugly to read.

I think this cuts both ways. Having to test whether search should return after
every search() call is also a bit messy.  Usually I'm very pedantic about
gotoless/jumpless programming but with chess programming I'm pragmatic all the
way.


>>I notice other engines use a flag which is tested at every node of the search.
>>Surely there's an overhead in doing it that way????
>
>a few nanoseconds. :)

Well, every little bit counts... :)


Thanks Bob.



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.