All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Julien Blanc <julien.blanc@sprinte.eu>,
	Pierre FICHEUX <pierre.ficheux@smile.fr>
Cc: Pierre FICHEUX via Xenomai <xenomai@xenomai.org>
Subject: Re: rt_task_inquire() equivalent for POSIX ?
Date: Thu, 7 Nov 2019 09:44:51 +0100	[thread overview]
Message-ID: <956fff32-9301-4b91-14b7-b2583f12508c@xenomai.org> (raw)
In-Reply-To: <148f7f7281a9350172cbd5895a223c500582f36d.camel@sprinte.eu>

On 2019-11-07 08:56, Julien Blanc via Xenomai wrote:
> Le jeudi 07 novembre 2019 à 06:47 +0100, Pierre FICHEUX via Xenomai a
> écrit :
>> I've tried it but got the pid of the "main" thread not the RT one
>> (that's
>> normal...).
>>
> 
> extern "C"
> {
>         int cobalt_thread_pid(pthread_t);
> }
> 
> int tid = cobalt_thread_pid(pthread_self())
> 
> but i’m not sure what you mean by the cobalt thread id vs posix thread
> id. IIRC they have the same value (ie, syscal(__NR_gettid) would give
> the same value (for rt threads), maybe at the expense of a mode
> switch).

This may be worth a read for context:
http://man7.org/linux/man-pages/man2/gettid.2.html

cobalt_thread_pid() translates POSIX thread identifiers to kernel thread identifiers some Linux-specific calls need (e.g. thread-directed signals).

-- 
Philippe.


  reply	other threads:[~2019-11-07  8:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06 21:04 rt_task_inquire() equivalent for POSIX ? Pierre FICHEUX
2019-11-07  0:20 ` Lowell Gilbert
2019-11-07  5:47   ` Pierre FICHEUX
2019-11-07  7:56     ` Julien Blanc
2019-11-07  8:44       ` Philippe Gerum [this message]
2019-11-07  9:03         ` Pierre FICHEUX
2019-11-07  8:04 ` Steve Freyder

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=956fff32-9301-4b91-14b7-b2583f12508c@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=julien.blanc@sprinte.eu \
    --cc=pierre.ficheux@smile.fr \
    --cc=xenomai@xenomai.org \
    /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.
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.