Thread ID of thread getting stack overflow?
Kurt Berg wrote: > We are seeking a PORTABLE way of getting the thread ID > of a thread experiencing a stack overflow. We have to do > some post processing to try to determine, given the thread > ID, what sort of thing to do. > > It is our understanding that pthread_self is NOT “async > signal safe”. > > Thanks in advance. Umm, as I mentioned in my reply to your email, once you buy into the concept of doing “portable” things in a signal handler (which represents a serious ERROR within the process), you’re climbing a steep slope with no equipment. Your fortune cookie says that a disastrous fall is in your future. I also commented that, although pthread_self isn’t required by the standard to be async-signal safe, it probably IS, (or, “close enough”), on most platforms. And in a program that’s done something “naughty” and unpredictable, asynchronously, to its address space, that’s as good as you’re going to get regardless of any standard. However, you neglected to mention in your email th