Subject: Re: [boost] [thread] API for getting/setting thread name in Boost?
From: Bob Summerwill (bob_at_[hidden])
Date: 2016-05-09 19:50:17
My language wasn't quite precise enough!
I don't believe there is a single implementation which will work on all
POSIX-compliant systems, but it looks like we're close enough to de-facto
standardization that we can get something which will work on all the major
It's essentially looking at:
Which gives you code something like this:
And the Windows equivalent:
Thanks, Vincente for setting up the Github issue tracker, and for your
reply. I will log an issue there now.
On Sun, May 8, 2016 at 5:34 AM, Vicente J. Botet Escriba <
> Le 06/05/2016 Ã 21:05, Bob Summerwill a Ã©crit :
>> My apologies for the cut-and-paste here. I had "digest enabled".
>> Vicente >> I remember this thread
>> Vicente >> Unfortunately not. Nobody provided a patch.
>> OK - well maybe I need to put that on my backlog. It just one code-path
>> for Windows and another for POSIX. Just a few lines of code for each.
> I don't know of a portable POSIX solution. Do you?
>> Vicente >> You can add a Feature request on Trac system or create an issue
>> Vicente >> Github, but I don't believe I will work on that if there is no
>> Vicente >> solution.
>> So I couldn't find an active issue tracker on the repos in Github.
> Oh, I believed there were one. I will request to the administrators to see
> what can be done.
>> tried to create a Trac issue, but it rejected my ticket for having
>> links (yep, there are a lot).
> Yes Trac don't support links :(.
>> Maybe it will be nicer to me if I had a SVN
>> account. I do not.
> You don't need an svn account.
>> Is trac the primary issue-tracker?
>> Yes. We want to move to github however.
>> On Wed, May 4, 2016 at 10:25 AM, Bob Summerwill <bob_at_[hidden]>
>> I've also been working with an external developer which is getting
>>> Ethereum C++ working on Alpine Linux, as a statically linked executable
>>> using musl, rather than glibc.
>>> One rather confusing element was related to setting and getting thread
>>> names, which is the process of working through this issue, I find appears
>>> not to have made its way into either Boost or the C++11 standard library,
>>> though it must be a very common cross-platform use-case.
>>> I've just added this comment-block, while fixing the issue:
>>> /// Set the current thread's log name.
>>> /// It appears that there is not currently any cross-platform way of
>>> /// thread names either in Boost or in the C++11 runtime libraries.
>>> What is
>>> /// more, the API for 'pthread_setname_np' is not even consistent across
>>> /// platforms which implement it.
>>> /// A proposal to add such functionality on the Boost mailing list, which
>>> /// I assume never happened, but which I should follow-up and ask about.
>>> /// man page for 'pthread_setname_np', including this crucial snippet of
>>> /// information ... "These functions are nonstandard GNU extensions."
>>> /// http://man7.org/linux/man-pages/man3/pthread_setname_np.3.html
>>> /// Stack Overflow "Can I set the name of a thread in pthreads / linux?"
>>> /// which includes useful information on the minor API differences
>>> /// Linux, BSD and OS X.
>>> /// musl mailng list posting "pthread set name on MIPs" which includes
>>> /// information that musl doesn't currently implement
>>> /// https://marc.info/?l=musl&m=146171729013062&w=1
>>> void setThreadName(std::string const& _n);
>>> Would I be right in assuming that this never happened?
>>> If not, where can I log an issue to request that we revisit that? From
>>> what I can see, everybody is likely just cut-and-pasting much the same
>>> for this functionality.
>>> Bob Summerwill
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk