From: Jan Kiszka <jan.kiszka@domain.hid>
To: "M. Koehrer" <mathias_koehrer@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] What returns rt_task_self in
Date: Wed, 22 Nov 2006 15:33:36 +0100 [thread overview]
Message-ID: <45645FC0.2060605@domain.hid> (raw)
In-Reply-To: <29258254.1164204998593.JavaMail.ngmail@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 2386 bytes --]
M. Koehrer wrote:
>> On Wed, 2006-11-22 at 14:14 +0100, Jan Kiszka wrote:
>>
>> [...]
>>
>>
>> Well, it actually does in intra-kernel calls, where rt_task_self()
>> returns the container object of the base nucleus thread present in the
>> RT_TASK struct the user passed us, even if nobody should rely on this
>> fact. I would try to clear any confusion like this:
>> "The address returned points at a descriptor identifying the calling
>> task, which might be different from the descriptor address passed to
>> rt_task_create()."
>>
>>> Jan
>>>
>>>
>>> PS: Who's supposed to free the descriptor allocated by rt_task_self?
>>> Would some check for pthread_getspecific(__native_tskey) + free() on
>>> task self-destruction make sense? Will not catch all cases, I know.
>>>
>> We could add that, and the same stuff upon return from the task body
>> inside the trampoline call, but the only way to solve this with no leak
>> would be to call the nucleus at each invocation, and not use any cached
>> descriptor here. Since TLS requires to be operated by the owning task,
>> there is no point in trying to have a deleted task clean those up
>> thoroughly.
> What about the idea that it is possible to retrieve the cookie that is used with
> rt_task_start() ?
> E.g. this could be provided with rt_task_inquire()?
Will require a syscall that is orders of magnitude slower than any
__thread variable.
Nevertheless, I don't see a reason why we shouldn't provide such trivial
service via rt_task_inquire. Could serve as a kind of fallback then for
weird architectures with lacking native TLS support. And might be useful
for other purposes as well.
> The rt_task_info struct has to be expanded for that.
>
> The main use case for this is that some user specific, task related data
> has to be stored. One pointer should be sufficient.
> I think, an approach that uses the Xenomai API for that is better than
> to rely on TLS or NPTL as it is unclear if related actions lead to an unwanted syscall.
The only reason to not rely on TLS support provided by recent NPTL is
that there is no NPTL. I don't share your concerns for the reasons I
wrote in the reply to Daniel.
>
> One (very ugly) approach could be to code an address into the name of the task.
> This name could be retrieved via rt_task_inquire()...
>
> Mathias
>
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
next prev parent reply other threads:[~2006-11-22 14:33 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 [this message]
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
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=45645FC0.2060605@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=mathias_koehrer@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.