From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] xnregistry_fetch & friends
Date: Tue, 26 Aug 2008 10:06:49 +0200 [thread overview]
Message-ID: <48B3B999.6000707@domain.hid> (raw)
In-Reply-To: <48B33926.9060808@domain.hid>
Jan Kiszka wrote:
> Philippe Gerum wrote:
>> Jan Kiszka wrote:
>>> But then I wonder
>>>
>>> a) why xnregistry_fetch uses nklock at all (even for totally uncritical
>>> XNOBJECT_SELF!)
>>>
>> registry_validate() returns a pointer we want to dereference; we'd better keep
>> this unpreemptable, although it's useless for the self-fetching op (which is an
>> unused calling mode so far). If using xnregistry_remove() while fetching the
>> object, the worst case is that your action ends up acting upon an object of the
>> same type, instead of the initially intended one. If that's a problem, goto safe;
>
> I still don't see the benefit in picking up the object pointer under
> nklock compared to the overhead of acquiring and releasing that lock.
> That's all not truly safe anyway. Even if you ensure that handle and
> object match, someone may change that pair before we can do the lookup
> under nklock.
Indeed, this is the whole point of the discussion unless I'm mistaken.
>
> In my understanding, registry slots either contain NULL or a pointer to
> some object. If that object is valid, that is checked _after_ releasing
> the lock, so we are unsafe again, _nothing_ gained.
Yes, I agree. I was focusing on _put/_get which maintain the refcount and ought
to be locked, but solely fetching under lock makes no sense. It's probably a
paranoid surge about having dynamically allocated slots, which won't happen
anytime soon.
>
> Jan
>
--
Philippe.
next prev parent reply other threads:[~2008-08-26 8:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-25 20:19 [Xenomai-core] xnregistry_fetch & friends Jan Kiszka
2008-08-25 22:11 ` Philippe Gerum
2008-08-25 22:58 ` Jan Kiszka
2008-08-26 8:06 ` Philippe Gerum [this message]
2008-08-26 8:27 ` Jan Kiszka
2008-08-26 8:41 ` Philippe Gerum
2008-08-26 8:52 ` Jan Kiszka
2008-08-26 9:09 ` Philippe Gerum
2008-08-26 12:49 ` Gilles Chanteperdrix
2008-08-26 13:08 ` Jan Kiszka
2008-08-26 13:13 ` Gilles Chanteperdrix
2008-08-26 13:18 ` Gilles Chanteperdrix
2008-08-26 13:32 ` Jan Kiszka
2008-08-26 13:38 ` Gilles Chanteperdrix
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=48B3B999.6000707@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.