Stack Problem

Started by
1 comment, last by Nash 20 years ago
Here is my problem. I have a main app with a ton of globals and it spins a ton of threads. I get a stack overflow error when I run it. In VC++, I set the project setting stack heap/ commit to be a larger value. This fixes my stack error. However, I can''t create all of my threads. I know CreateThread has a stack size param but it does not seem to do anything for me. Could someone explain the stack setting in the project? Thanks.
Advertisement
Well, having a ton of globals, spinning a ton of threads and running into stack overflow problems sounds like bad design to me. Re-design and you''ll probably have much less problems now and in the future.
Increasing the size of the stack may just be masking the problem. Chances are it will come back and bite you in the ass. I would suspect a logic error first. Could be you have some unwanted recursion, or a simple overwrite of a boundry for a local variable.

This topic is closed to new replies.

Advertisement