All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH] libnative: Avoid double-evaluation of rt_task_self()
Date: Sat, 04 Apr 2009 11:18:22 +0200	[thread overview]
Message-ID: <1238836702.6932.179.camel@domain.hid> (raw)
In-Reply-To: <49D70E31.4070706@domain.hid>

On Sat, 2009-04-04 at 09:37 +0200, Jan Kiszka wrote:
> Philippe Gerum wrote:
> > On Thu, 2009-04-02 at 23:40 +0200, Gilles Chanteperdrix wrote:
> >> Jan Kiszka wrote:
> >>> [ can be pulled from git.xenomai.org/xenomai-jki.git queues/assorted ]
> >>>
> >>> Keep the result of rt_task_self() in a local variable to avoid the
> >>> second invocation.
> >> Maybe we could create a pure/const variant of rt_task_self() for use in
> >> task.c only which would avoid the double evaluatino ?
> >>
> > 
> > Can't do const because of pthread_getspecific(), but pure attribute is t
> > hand, yes.
> > 
> 
> At least my gcc 4.3 ignores
> 
> RT_TASK *rt_task_self(void) __attribute__ ((pure));
> 

We can't do that on rt_task_self() directly, because of
rt_task_shadow().

> and keeps on inserting two calls in rt_task_delete.
> 

What if a pure static inline helper is used internally from task.c?

> Jan
> 
-- 
Philippe.




  reply	other threads:[~2009-04-04  9:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-02 19:36 [Xenomai-core] [PATCH] libnative: Avoid double-evaluation of rt_task_self() Jan Kiszka
2009-04-02 21:40 ` Gilles Chanteperdrix
2009-04-02 21:45   ` Philippe Gerum
2009-04-04  7:37     ` Jan Kiszka
2009-04-04  9:18       ` Philippe Gerum [this message]
2009-04-13 16:13         ` Jan Kiszka

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=1238836702.6932.179.camel@domain.hid \
    --to=rpm@xenomai.org \
    --cc=jan.kiszka@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.