I need to stop execution during recursive algorithm
- by Shaza
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.