Chess

Here you can talk about everything that's offtopic.

Moderator: Dust

Jora
Ex-boss
Posts: 2338
Joined: 01 Jan 1970 01:00
Contact:

Post by Jora » 11 Jun 2007 17:11

In general it is never a good idea to block UI completely.
Especially such a thinking thread can easily be cancelled in between for such an undo.
User avatar
Dust
The Boss
Posts: 9093
Joined: 01 Jan 1970 01:00
Contact:

Post by Dust » 11 Jun 2007 18:33

The UI is not blocked, you can do stuff you are allowed to do :)

(That's why I use threads)

Aborting threads is ... evil...
I do what I think is right. But I don't think that what I think is right can not be wrong.
Colyn
Die-Harder
Posts: 2721
Joined: 01 Jan 1970 01:00
Location: Cambridge, UK
Contact:

Post by Colyn » 12 Jun 2007 10:59

But... You're not killing a thread, your simply asking the thread the poll occasionally for UI input and exit cleanly. :(

Not trying to teach grandma to suck eggs but I can give you some sample code if you like.
Colyn | Warrior
Squirrels chase Magpies. It's true. I've seen it...
User avatar
Dust
The Boss
Posts: 9093
Joined: 01 Jan 1970 01:00
Contact:

Post by Dust » 12 Jun 2007 12:48

I know how to do it, the worker thread objects have even an api to abort them. But it just seems bad to interrupt an enemy in a chess game. (I was not even sure if I should allow you to change the piece once you touched it...)
I do what I think is right. But I don't think that what I think is right can not be wrong.
Colyn
Die-Harder
Posts: 2721
Joined: 01 Jan 1970 01:00
Location: Cambridge, UK
Contact:

Post by Colyn » 12 Jun 2007 13:36

Lol... I think. Interrupting the AI will have no lasting effects I presume i.e. it won't lose its train of thought or weaken its ability to repeat the analysis once the user is happy?
Colyn | Warrior
Squirrels chase Magpies. It's true. I've seen it...
Grumthorn
Die-hard
Posts: 2231
Joined: 01 Jan 1970 01:00
Location: Waterford, Ireland
Contact:

Post by Grumthorn » 12 Jun 2007 13:38

Colyn wrote:Lol... I think. Interrupting the AI will have no lasting effects I presume i.e. it won't lose its train of thought or weaken its ability to repeat the analysis once the user is happy?
If the user takes back a move the initial position of the board where the strategy thread starts its search may be different, so effectively you will have to restart it from scratch.
Every man's death diminishes me, for I am involved in all mankind.
Therefore, send not to know for whom the bell tolls; it tolls for thee.
Colyn
Die-Harder
Posts: 2721
Joined: 01 Jan 1970 01:00
Location: Cambridge, UK
Contact:

Post by Colyn » 12 Jun 2007 14:08

Yes Grum but what's your point? Mine is that interrupting the engine does nothing to it. The only effect is on the user who chose to interrupt it in the first place.
Colyn | Warrior
Squirrels chase Magpies. It's true. I've seen it...
Grumthorn
Die-hard
Posts: 2231
Joined: 01 Jan 1970 01:00
Location: Waterford, Ireland
Contact:

Post by Grumthorn » 12 Jun 2007 14:18

Colyn wrote:Yes Grum but what's your point? Mine is that interrupting the engine does nothing to it. The only effect is on the user who chose to interrupt it in the first place.
My point is that if you interrupt the strategy thread to take back a move you change the assumptions of the strategy thread (specifically the opening board position but also possibly including such things as search depth parameters). Ergo the suspendability/resumability of such a thread is moot and the only sensible practice is a graceful exit and creating a fresh thread when the user is done.

In other words I can't see how you can support the statement that interrupting the engine does nothing to it.
Every man's death diminishes me, for I am involved in all mankind.
Therefore, send not to know for whom the bell tolls; it tolls for thee.
Colyn
Die-Harder
Posts: 2721
Joined: 01 Jan 1970 01:00
Location: Cambridge, UK
Contact:

Post by Colyn » 12 Jun 2007 14:35

You've made a huge assumption Grum which is that I advocated the resumption of the processing thread, I never suggested that this be the case.
Colyn wrote:it won't lose its train of thought or weaken its ability to repeat the analysis once the user is happy?
Colyn | Warrior
Squirrels chase Magpies. It's true. I've seen it...
Grumthorn
Die-hard
Posts: 2231
Joined: 01 Jan 1970 01:00
Location: Waterford, Ireland
Contact:

Post by Grumthorn » 12 Jun 2007 14:43

Colyn wrote:You've made a huge assumption Grum which is that I advocated the resumption of the processing thread, I never suggested that this be the case.
Colyn wrote:it won't lose its train of thought or weaken its ability to repeat the analysis once the user is happy?
Your use of the word interrupt is different from mine then :) And if I were really feeling nitpicky I'd point out that it _does_ make it lose its train of thought. (oh wait, I am feeling really nitpicky).

Enough anyway. We're all both right and wrong. Tea and cakesfor everybody.
Every man's death diminishes me, for I am involved in all mankind.
Therefore, send not to know for whom the bell tolls; it tolls for thee.
Colyn
Die-Harder
Posts: 2721
Joined: 01 Jan 1970 01:00
Location: Cambridge, UK
Contact:

Post by Colyn » 12 Jun 2007 14:52

Grumthorn wrote:Your use of the word interrupt is different from mine then :) And if I were really feeling nitpicky I'd point out that it _does_ make it lose its train of thought. (oh wait, I am feeling really nitpicky).
Oh good, I'm feeling nitpicky too...
On the meaning of [b]interrupt[/b], dictionary.com wrote:2. to break off or cause to cease, as in the middle of something: He interrupted his work to answer the bell.
...
4. to cause a break or discontinuance; interfere with action or speech, esp. by interjecting a remark: Please don't interrupt.
I'm still up for tea and cakes tho.. :)
Colyn | Warrior
Squirrels chase Magpies. It's true. I've seen it...
Grumthorn
Die-hard
Posts: 2231
Joined: 01 Jan 1970 01:00
Location: Waterford, Ireland
Contact:

Post by Grumthorn » 12 Jun 2007 15:01

Colyn wrote:
Grumthorn wrote: Oh good, I'm feeling nitpicky too...
On the meaning of [b]interrupt[/b], dictionary.com wrote:2. to break off or cause to cease, as in the middle of something: He interrupted his work to answer the bell.
...
4. to cause a break or discontinuance; interfere with action or speech, esp. by interjecting a remark: Please don't interrupt.
Both those examples from your quote imply later continuance do they not?

your move sir, your move.
Every man's death diminishes me, for I am involved in all mankind.
Therefore, send not to know for whom the bell tolls; it tolls for thee.
Colyn
Die-Harder
Posts: 2721
Joined: 01 Jan 1970 01:00
Location: Cambridge, UK
Contact:

Post by Colyn » 12 Jun 2007 15:21

"or cause to cease" and "discontinuance" imply later continuance? I would argue that they do not on the grounds that... well... they clearly don't.

:lol:
Colyn | Warrior
Squirrels chase Magpies. It's true. I've seen it...
User avatar
Cyberia
Site Admin
Posts: 4790
Joined: 01 Jan 1970 01:00
Contact:

Post by Cyberia » 12 Jun 2007 22:52

If your going to quote the dictionary at least quote the relevant parts;
Interrupt can have either meaning;
  • To discontinue is to stop or leave off, often permanently: to discontinue a building program.
  • To suspend is to break off relations, operations, proceedings, privileges, etc., for a certain period of time, usually with the stipulation that they will be resumed at a stated time:
So as Grum said your both wrong ( now I'm misquoting :) ).
Grumthorn
Die-hard
Posts: 2231
Joined: 01 Jan 1970 01:00
Location: Waterford, Ireland
Contact:

Post by Grumthorn » 13 Jun 2007 00:31

Cyberia wrote: So as Grum said you're both wrong ( now I'm misquoting :) ).
And misspelling you're. (I declare a pickfest!)
Every man's death diminishes me, for I am involved in all mankind.
Therefore, send not to know for whom the bell tolls; it tolls for thee.
Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests