unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Robert Pluim <rpluim@gmail.com>
Cc: 38632@debbugs.gnu.org, yantar92@gmail.com
Subject: bug#38632: 27.0.50; Emacs process name is changed permanently upon creating a named thread
Date: Wed, 18 Dec 2019 17:53:49 +0200	[thread overview]
Message-ID: <83v9qd3a0i.fsf@gnu.org> (raw)
In-Reply-To: <m236dit349.fsf@gmail.com> (message from Robert Pluim on Wed, 18 Dec 2019 10:05:58 +0100)

> From: Robert Pluim <rpluim@gmail.com>
> Cc: Ihor Radchenko <yantar92@gmail.com>,  38632@debbugs.gnu.org
> Date: Wed, 18 Dec 2019 10:05:58 +0100
> 
>     Eli> I think, instead of calling prctl in systhread.c, we should call
>     Eli> pthread_set_name_np, and the configure-time test for prctl should be
>     Eli> replaced with a test for pthread_set_name_np.
> 
> Would it not be easier to call prctl in the context of the created
> thread? That way it deals with the name length issues for us:
> pthread_setname_np fails if strlen(name) >= 16, wherease prctl
> truncates.

AFAIU, prctl is Linux-specific, whereas pthread_setname_np is
supported on other Posix platforms that provide pthreads.  Also, prctl
has another disadvantage, in that it requires you to pass the name to
the thread being created, or put it in some global.  OTOH, truncating
a string is not exactly rocket science, we can do that ourselves
before calling the API.

(Btw, the limitation is 16 bytes, including the terminating null, so
truncation needs to be clever about non-ASCII characters, and I wonder
what does prctl do when 15 bytes end in the middle of a multibyte
sequence.)





  reply	other threads:[~2019-12-18 15:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16  6:42 bug#38632: 27.0.50; Emacs process name is changed permanently upon creating a named thread Ihor Radchenko
2019-12-17 20:05 ` Eli Zaretskii
2019-12-18  9:05   ` Robert Pluim
2019-12-18 15:53     ` Eli Zaretskii [this message]
2019-12-18 17:04       ` Robert Pluim
2019-12-18 17:18         ` Eli Zaretskii
2019-12-18 21:30           ` Robert Pluim
2019-12-19 15:11             ` Eli Zaretskii
2019-12-19 16:42               ` Robert Pluim
2019-12-19 18:56                 ` Eli Zaretskii
2019-12-20 19:13               ` Eli Zaretskii
2020-01-06 14:43                 ` Robert Pluim
2020-01-06 16:22                   ` Eli Zaretskii
2020-01-06 19:50 ` Mattias Engdegård
2020-01-06 21:58   ` Mattias Engdegård
2020-01-06 23:06     ` Robert Pluim
2020-01-07 15:45     ` Eli Zaretskii
2020-01-07 16:46       ` Mattias Engdegård
2020-01-07 17:05         ` Eli Zaretskii
2020-01-07 17:07         ` Eli Zaretskii
2020-01-07 17:19           ` Mattias Engdegård
2020-01-08 18:26         ` Glenn Morris
2020-01-08 18:54           ` Eli Zaretskii
2020-01-08 19:34             ` Glenn Morris
2020-01-08 20:01               ` Eli Zaretskii
2020-01-06 22:21   ` Robert Pluim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83v9qd3a0i.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=38632@debbugs.gnu.org \
    --cc=rpluim@gmail.com \
    --cc=yantar92@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).