Re: AW: [Xenomai-help] delete queues offline; /proc/stat

2006-07-06 Thread Gilles Chanteperdrix
[EMAIL PROTECTED] wrote:
when a xenomai-task crashs which created some queues 
(rt_queue_create) 
and I try to restart the task the creation of the queues 
will fail as 
the queue still exists (error EEXIST == 17). Is there a 
possibility to 
see which queues exist (I did not find a hint in the /proc/xenomai
directory) and to get rid of these queues (or geneally 
spoken : to get 
rid of allocated resources) e.g. with a commandline tool ?
  
   
   Native or posix skin? Gilles added per-process resource 
   cleanup to the posix skin in 2.2-rc3.
  
  
  following Murphys law, I, of course, use native skin where this mechanism 
  isnĀ“t 
  implemented yet ;-)
  What does per-process resource cleanup mean ? 
  When the process/thread is killed the queues and other resources of this 
  process/thread are deleted automaticaly ?

Yes, all resources specific to a process are deleted automatically, so,
any message queue descriptor or shared memory descriptor is
closed. Named objects are not deleted though, since they may be shared
between several processes, only non-pshared anonymous objects and named
objects *descriptors* are deleted. This is the only reasonable
implementation I could find.

-- 


Gilles Chanteperdrix.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: AW: [Xenomai-help] delete queues offline; /proc/stat

2006-07-06 Thread Jan Kiszka
Gilles Chanteperdrix wrote:
 [EMAIL PROTECTED] wrote:
 when a xenomai-task crashs which created some queues 
 (rt_queue_create) 
 and I try to restart the task the creation of the queues 
 will fail as 
 the queue still exists (error EEXIST == 17). Is there a 
 possibility to 
 see which queues exist (I did not find a hint in the /proc/xenomai
 directory) and to get rid of these queues (or geneally 
 spoken : to get 
 rid of allocated resources) e.g. with a commandline tool ?
   

Native or posix skin? Gilles added per-process resource 
cleanup to the posix skin in 2.2-rc3.
   
   
   following Murphys law, I, of course, use native skin where this mechanism 
 isn?t 
   implemented yet ;-)
   What does per-process resource cleanup mean ? 
   When the process/thread is killed the queues and other resources of this 
   process/thread are deleted automaticaly ?
 
 Yes, all resources specific to a process are deleted automatically, so,
 any message queue descriptor or shared memory descriptor is
 closed. Named objects are not deleted though, since they may be shared
 between several processes, only non-pshared anonymous objects and named
 objects *descriptors* are deleted. This is the only reasonable
 implementation I could find.

What about a usage counter maintained on creation/binding vs.
closing/destruction? I would prefer to get them cleaned up automatically
as well somehow, or we really need tool support for IPC cleanup, and
that is ugly in my eyes.

Jan



signature.asc
Description: OpenPGP digital signature
___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: AW: [Xenomai-help] delete queues offline; /proc/stat

2006-07-06 Thread Gilles Chanteperdrix
Jan Kiszka wrote:
   Yes, all resources specific to a process are deleted automatically, so,
   any message queue descriptor or shared memory descriptor is
   closed. Named objects are not deleted though, since they may be shared
   between several processes, only non-pshared anonymous objects and named
   objects *descriptors* are deleted. This is the only reasonable
   implementation I could find.
  
  What about a usage counter maintained on creation/binding vs.
  closing/destruction? I would prefer to get them cleaned up automatically
  as well somehow, or we really need tool support for IPC cleanup, and
  that is ugly in my eyes.

I am not sure one would expect a named object to be unlinked when one only
calls its close service, without calling its unlink service. If, on
the other hand, one calls the unlink service, then the object will be
automatically destroyed when the last descriptor is closed, as mandated
by the specification.

Moreover, the existence of such objects is not a leak that will grow
over time, if one do not use the O_EXCL flag when opening objects,
existing objects will simply be reused. If one use the O_EXCL flag,
opening will fail.

This behaviour is the same as Linux behaviour.

-- 


Gilles Chanteperdrix.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: AW: [Xenomai-help] delete queues offline; /proc/stat

2006-07-06 Thread Philippe Gerum
On Thu, 2006-07-06 at 13:59 +0200, Gilles Chanteperdrix wrote:
 Jan Kiszka wrote:
Yes, all resources specific to a process are deleted automatically, so,
any message queue descriptor or shared memory descriptor is
closed. Named objects are not deleted though, since they may be shared
between several processes, only non-pshared anonymous objects and named
objects *descriptors* are deleted. This is the only reasonable
implementation I could find.
   
   What about a usage counter maintained on creation/binding vs.
   closing/destruction? I would prefer to get them cleaned up automatically
   as well somehow, or we really need tool support for IPC cleanup, and
   that is ugly in my eyes.
 
 I am not sure one would expect a named object to be unlinked when one only
 calls its close service, without calling its unlink service. If, on
 the other hand, one calls the unlink service, then the object will be
 automatically destroyed when the last descriptor is closed, as mandated
 by the specification.

I agree with this interpretation. Think of some application loader
process that just creates the basic infrastructure, like shared mem
segs, then exits, leaving the actual use of such resources to some other
processes. I did see this a few times in customer designs.

 
 Moreover, the existence of such objects is not a leak that will grow
 over time, if one do not use the O_EXCL flag when opening objects,
 existing objects will simply be reused. If one use the O_EXCL flag,
 opening will fail.
 
 This behaviour is the same as Linux behaviour.
 
-- 
Philippe.



___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help