This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Application hangs with mutliple threads in atomicity functions



Well, you should be able to step through these atomic functions and
see what they're doing: as they're at 100% cpu they aren't waiting on
mutexes.  So, attach your trusty debugger to the threads and
single-step to see what's going on.

Again I am not as familiar as I would like to be with the internals of gcc or libstdc++, but I understand that the atomic functions employ spin-locks for efficiency. If that is the case then wouldn't they spin perpetually and consume 100% CPU if dead-lock were to occur? This was just an assumption, but I will take your advice and step in with the debugger to verify.


Valgrind would almost certainly help you here, but Solaris isn't
supported.  Purify does support Solaris, but costs real money.

Great suggestion. I will try building it in Linux and take advantage of Valgrind.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]