Hey guys I'm trying to do threading in to solve a maze algorithm.
The catch is this, the max "life" of the thread is 3.
So if the thread hit a danger spot, lets say "X".
The system will exit.
I'm able to solve the algorithm but I don't know how to set the thread process limit.
Anyone care to teach me? Thx!!
Since the code are way too long, I show the part where there create the thread.
Consider using the C++11 (formerly 0x) thread objects.
With that you can do all these much more easily.
And you can.. for example.. keep a counter.. of the objects and stop generating more as you wish.