How to calculate the StackSize Required
Hi Friends,
I need to set the stack size for a thread (by invoking "pthread_attr_setstacksize", but my question is not about this function as such, but how to fix the Stack Size in general). I have been using this for a while. But all the time I had been giving few KBs. And if the program crashes with some memory corruption, I increase the stack size and test. But I feel this is not an effective way of doing.
Is there a way to effectively calculate the stack size thats required for a thread (created using "pthread_create").
Thanks in advance.
./Ebin.
|