How to maintain responsiveness during long functions?


Recently, two people have sent me some very good reversi algorithms
for inclusion into iagno.  Since many people have complained about the
skill level of the computer players (very low), this is a good thing.
However, obviously both algorithms need to spend a good bit of time
thinking, and currently, this means that the game does not respond (ie
menus, redraws, etc are not handled) until the computer makes its

What is the `proper' way to handle this?  Is there any simple way to
tell it to process any pending events at critical junctions in the
algorithm, or do I have to either restructure the algorithms to work
through with the gtk event system, or make the application threaded?

Any assistance that anyone can provide would be much, much

Ian Peters  | GnuPG Key ID 5C23D20C    | "He that breaks a thing to find out | E584 2558 FAC3 BEAB EFAC |  what it is has left the path of | FC74 CFED 7E24 5C23 D20C |  wisdom." -- J.R.R. Tolkien

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