Subj : Re: Linux thread weird problem.. To : comp.programming.threads From : Joe Seigh Date : Fri Jul 01 2005 07:53 am -RS wrote: > Hi experts, > > A bit background: I am integrating a C module to a c++ framework. The > C module is single thread, while c++ frameowrk multiple creates > threads for each connector it creates. The pipes are being used to get > notifications from the c++ threads. > > While regression testing with single connector, the application works > great! But with 2 connectors, it locks. > > When hacked with gdb, it is the main thread that looks locked (ps -m > shows it in Running state and rest of the c++ threads in Sleeping > state). The next step shown is part of STL always. (There is no other > thread accessing data in main thread). > > The regression test of creating 2 connectors, in a sample c++ > application, works just fine. > > I am a bit lost here as, why the main thread is getting locked in STL? > Is there any issues with STL? Do the versions of libraries of c++ > modules have something to do with this? STL is only thread-safe as "int", it's not reentrant. I don't think C has anything to do with it. If you're calling C++ code, you have a C++ program. You may not be using the api correctly or your api may not be as thread-safe as you think it it. Debugging deadlock is just a matter of looking at the stack traces to see what your threads are waiting for. -- Joe Seigh When you get lemons, you make lemonade. When you get hardware, you make software. .