In Windows, it is possible to set the threadname via this code. The threadname is then shown in debuggers.
Under Linux, see this question.
In MacOSX, I have seen several hints which indicates that there are threadnames. I think the class NSThread also has a name-attribute. My goal is that I can set the threadname in my C++ application and see it in Xcode/gdb.