stack backtrace with pthreads
Hi all,
I was just wondering if there exist any issues of using stack backtraces ( int backtrace (void **buffer, int size) ) with multithreaded applications, specifically pthreads compared to using backtraces with single process/thread applications. I know the backtraces are for back-tracing the current thread, but just wondering if I should be aware of anything uncertain to happen if I use the two together or any tips :) . The reason I'm asking this question is that its easier to debug applications when you know a problem wont occur because of some issue (namely backtrace with pthreads) and you can then narrow down where the problem can occur. Thanks in advance! |
under linux, each thread is given its own stack. so in theory, you should be fine. You might want to check out my new blog (http://monkey-coder.blogspot.com) where my first post shows an alternate backtracing function which should be portable. (tested on x86 and powerpc linux, and on cygwin).
|
Thanks orgcandman. Thats a nice blog you've got there. :)
|
All times are GMT -5. The time now is 01:43 PM. |