All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Daniel Schnell <daniel.schnell@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] What returns rt_task_self in relation	tort_task_create
Date: Wed, 22 Nov 2006 15:06:42 +0100	[thread overview]
Message-ID: <45645972.5040103@domain.hid> (raw)
In-Reply-To: <DD39B5C3F4963040ADC9768BE7E430CB015D4F9C@is-hdq-exchange.marel.net>

[-- Attachment #1: Type: text/plain, Size: 1570 bytes --]

Daniel Schnell wrote:
> Philippe Gerum wrote:
>> Use pthread_getspecific() for obtaining back a TLS data previously
>> defined by pthread_setspecific(), indexed on a TLS key obtained from
>> pthread_key_create(). Warning: AFAICT, only pthread_getspecific()
>> refrain from performing any kind of Linux syscall (in the current
>> NPTL and older LinuxThreads implementation, that is), thus won't
>> migrate your RT task to secondary mode when called. The two others
>> could call vanilla kernel services, so you must use them during
>> non-critical preliminary init steps of your task.       
> 
> Does this mean that if you use pthread_getspecific() inside a user-space
> application you will not switch to secondary mode ? I was just
> abandoning using TLS because I could not imagine how the NPTL's
> functionality can be done without a system call. Is this behaviour
> something one can rely on in the future ?

AFAIK, the TLS ABIs for all relevant architectures are build upon
mechanisms (typically registers, sometimes with further pointer walks)
that avoid syscalls - already for performance reasons.

The only thing I'm not sure of is if all implementations create TLS
space during thread setup or on first access. But as you will likely
fill in data during setup anyway, that should be no practical problem.

> 
> Is there something similar like TLS inside the native API ?

No need for it, at least in user-space. Use what glibc and the kernel
provide to you. Specifically __thread variables are very handy and
efficient.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

  reply	other threads:[~2006-11-22 14:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-22 11:38 [Xenomai-help] What returns rt_task_self in relation to rt_task_create M. Koehrer
2006-11-22 12:04 ` Jan Kiszka
2006-11-22 12:52   ` Philippe Gerum
2006-11-22 13:14     ` Jan Kiszka
2006-11-22 14:00       ` Philippe Gerum
2006-11-22 14:03         ` Gilles Chanteperdrix
2006-11-22 14:22           ` Philippe Gerum
2006-11-22 16:34             ` Gilles Chanteperdrix
2006-11-22 17:03               ` Philippe Gerum
2006-11-22 17:38                 ` Gilles Chanteperdrix
2006-11-22 18:33                   ` Philippe Gerum
2006-11-22 14:16         ` Re: [Xenomai-help] What returns rt_task_self in M. Koehrer
2006-11-22 14:33           ` Jan Kiszka
2006-11-22 14:49           ` Philippe Gerum
2006-11-22 13:09 ` [Xenomai-help] What returns rt_task_self in relation to rt_task_create Philippe Gerum
2006-11-22 13:48   ` [Xenomai-help] What returns rt_task_self in relation tort_task_create Daniel Schnell
2006-11-22 14:06     ` Jan Kiszka [this message]
2006-11-22 14:16     ` Philippe Gerum
2006-11-22 14:23       ` Philippe Gerum

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=45645972.5040103@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=daniel.schnell@domain.hid \
    --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.