
This is exactly what I meant when I said "to associate the setting of the name attribute to the thread_attributes class so that the implementation can set it at the start of the thread. "
So that the setting can not be of the thread class as the thread will be already started.
First, a silly question: where is thread::attributes documented? I looked at the boost.org pages on the thread library, but never found a good, concise reference for what the members of thread::attributes are. Second: Just having a free function under this_thread to set the name in a portable fashion would be a start - at least prctl and the GLib functions can be called at any time to set the thread name. If there were a void this_thread::set_name(std::string name) that would meet most of my needs. (indeed - in times past I've used something like that to help debugging - change the "name" of the thread to indicate state as the thread operates, so you can easily see where a thread is in its operation just by using top or ps).