I need to stop execution during recursive algorithm
Posted
by Shaza
on Stack Overflow
See other posts from Stack Overflow
or by Shaza
Published on 2010-03-27T13:51:43Z
Indexed on
2010/03/27
13:53 UTC
Read the original article
Hit count: 293
Hey, I have a problem in choosing the right method to accomplish my goal. I'm working on Algorithms teaching system, I'm using C#. I need to divide my algorithm into steps, each step will contain a recursion. I have to stop execution after each step, user can then move to the next step(next recursion) using a button in my GUI.
After searching, threads was the right choice, but I found several methods:
(Thread.sleep/interrupt): didn't work, my GUI freezed !!
(Suspend/Resume): I've read that it's a bad idea to use.
(Waithandles): still reading about them.
(Monitor wait/resume).
I don't have much time to try and read all previous methods, please help me in choosing the best method that fits my system.Any suggestions are extremal welcomed.
© Stack Overflow or respective owner