Saurabh Jain wrote: > --- In [email protected], Thomas Hruska <[EMAIL PROTECTED]> wrote: >> kumars wrote: >>> It's giving me segmentation fault when I am trying to execute with > following >>> options >>> >>> ./main -r 10 -w 4 -s 10 >>> >>> (here 'r' is the number of reader thread >>> 'w' is the number of writer thread >>> 's' is the size of bytes) >>> >>> But when I am exceuting it as follows it works fine >>> >>> ./main -r 10 -w 3 -s 10 >>> >>> Please look into it, why it's failing when I am trying to create 4 > or more >>> number of writer threads. >> Reproducible crash bugs should be fairly easy to diagnose: Build a >> debug version, run through 'gdb' (or, my personal preference, an IDE >> that uses gdb behind the scenes such as KDevelop). Let it crash and >> then walk back up the stack. > > It has always intrigued me, but I never tried. How easy/difficult is > it to debug a multi-threaded program in gdb (I think that is what OP > wants to do). Would be really interesting to know strategies used by > others to debug issues in multi-threaded application. > > In the meanwhile I should be searching gdb documentation about > multi-treaded debugging. But I would love to know how others handle > multi-treaded issues. > > Thanks and Regards, > Saurabh
I don't know. I prefer the IDE approach. The VC++ IDE allows you to switch between threads and step through code that way, but it does get confusing when you start getting more than a couple threads as it will bounce around the code a LOT if you simply step through. I'm sure KDevelop does something similar (hopefully). 3 to 4 threads is still manageable though. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/
