Page 2 of 3
Posted: 11 Jun 2007 17:11
by Jora
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.
Posted: 11 Jun 2007 18:33
by Dust
The UI is not blocked, you can do stuff you are allowed to do :)
(That's why I use threads)
Aborting threads is ... evil...
Posted: 12 Jun 2007 10:59
by Colyn
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.
Posted: 12 Jun 2007 12:48
by Dust
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...)
Posted: 12 Jun 2007 13:36
by Colyn
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?
Posted: 12 Jun 2007 13:38
by Grumthorn
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.
Posted: 12 Jun 2007 14:08
by Colyn
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.
Posted: 12 Jun 2007 14:18
by Grumthorn
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.
Posted: 12 Jun 2007 14:35
by Colyn
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?
Posted: 12 Jun 2007 14:43
by Grumthorn
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.
Posted: 12 Jun 2007 14:52
by Colyn
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..

Posted: 12 Jun 2007 15:01
by Grumthorn
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.
Posted: 12 Jun 2007 15:21
by Colyn
"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.

Posted: 12 Jun 2007 22:52
by Cyberia
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

).
Posted: 13 Jun 2007 00:31
by Grumthorn
Cyberia wrote:
So as Grum said you're both wrong ( now I'm misquoting

).
And misspelling you're. (I declare a pickfest!)