all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
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 18:04:53 +0100	[thread overview]
Message-ID: <m2woat5zuy.fsf@gmail.com> (raw)
In-Reply-To: <83v9qd3a0i.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 18 Dec 2019 17:53:49 +0200")

>>>>> On Wed, 18 Dec 2019 17:53:49 +0200, Eli Zaretskii <eliz@gnu.org> said:

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

We already use a wrapper function to call the user-supplied function,
so prctl could be added there, but the wider availability of
pthread_setname_np weighs in its favour.

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

It does exactly what you'd expect, it drops the extraneous bytes, so
putting eg ü on the boundary results in a name ending in à (#xc3).

In any case, if emacs or prctl truncates, then the name as reported
by 'list-threads' will be out of sync with pthread_getname_np, unless
you'd want to adjust that too.

Robert





  reply	other threads:[~2019-12-18 17:04 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
2019-12-18 17:04       ` Robert Pluim [this message]
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

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

  git send-email \
    --in-reply-to=m2woat5zuy.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=38632@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.