All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: Petr Cervenka <grugh@domain.hid>, xenomai-help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] rt_queue_bind() returns -EACCES
Date: Thu, 11 Aug 2011 12:06:18 +0200	[thread overview]
Message-ID: <1313057178.2133.80.camel@domain.hid> (raw)
In-Reply-To: <1313057016.2133.79.camel@domain.hid>

On Thu, 2011-08-11 at 12:03 +0200, Philippe Gerum wrote:
> On Thu, 2011-08-11 at 11:37 +0200, Gilles Chanteperdrix wrote:
> > On 08/11/2011 11:10 AM, Philippe Gerum wrote:
> > > On Thu, 2011-08-11 at 10:33 +0200, Petr Cervenka wrote:
> > >> Hello.
> > >>
> > >> I created a simple examples which describe my problem.
> > >> It is some kind of server and client.
> > >> At first run a qserver and then qclient.
> > >> After that close the qserver and try to run it again.
> > >> It disallows (in my configuratio) to create the queue because it already exists and also the binding to it fails with error -EACCES.
> > >> This behavior continues till the qclient is closed. It's perhaps caused by the rt_queue_delete() at the end of qserver.
> > > 
> > > That is the intended behavior. When deleted, the queue is maintained
> > > internally until the last client bound to it exits, which also disallows
> > > creating another queue with the same name until the latter event
> > > happens.
> > > 
> > > However, deleting the queue also makes it unreachable for further
> > > bindings, until it is completely dismantled after the last client exits.
> > > At which point you may re-create a queue with the same name and bind to
> > > it. Logically speaking, that deleted queue does not exist anymore,
> > > except for the currently bound client(s), for consistency reasons.
> > 
> > Maybe we could return -EIDRM instead of -EEXIST when in this case?
> > 
> 
> Not sure. EIDRM is conventionally about telling the caller that some
> previously valid identifier has been revoked while the operation was
> ongoing, which does not match the case of trying to establish a fresh
> binding to a zombie object.

Or trying to create a new object, the same way.

>  In the first case, we did have a valid
> object on entry, in the second one, that object has never been valid
> from the caller's standpoint.
> 
> I'm unsure that returning EIDRM would be trivial to implement anyway. We
> would have to make the registry layer aware of the "magic" tags used by
> the upstream interfaces, so that it could check atomically EIDRM vs
> EEXIST when failing to hash the object key. Granted, we could move this
> magic into the xnobject struct directly though and get rid of it
> elsewhere. Some work ahead in such a case.
> 

-- 
Philippe.




  reply	other threads:[~2011-08-11 10:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-09 15:40 [Xenomai-help] rt_queue_bind() returns -EACCES Petr Cervenka
2011-08-09 16:03 ` Philippe Gerum
2011-08-11  8:33   ` Petr Cervenka
2011-08-11  9:10     ` Philippe Gerum
2011-08-11  9:37       ` Gilles Chanteperdrix
2011-08-11 10:03         ` Philippe Gerum
2011-08-11 10:06           ` Philippe Gerum [this message]
2011-08-12 15:13             ` Petr Cervenka

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=1313057178.2133.80.camel@domain.hid \
    --to=rpm@xenomai.org \
    --cc=gilles.chanteperdrix@xenomai.org \
    --cc=grugh@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.