All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Posix vs Alchemy - multiplexing and registry
@ 2018-01-25 13:43 Julien Blanc
  2018-01-25 14:21 ` Philippe Gerum
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Blanc @ 2018-01-25 13:43 UTC (permalink / raw)
  To: xenomai

Hi,

We have a xenomai 3 application currently using the alchemy API
(application development started on xenomai 2.x).

We would like to add I/O multiplexing in some parts of the application.
My understanding is that it is not supported by the alchemy API, so we
would have to resort to the Posix API.

The downside is that by doing so, we lose the registry : with the posix
api nothing is exported. We would like to access all this data, at
least for debugging purposes (ideally, disable it in production build).

I couldnt find any pointer for doing either of the following :
- enable the registry while using the posix API
- multiplex using the alchemy api
- retrieve a posix-api compatible file descriptor from an alchemy
handle (which would allow a __cobalt_select call)

Is there some resources or something obvious that i'm missing ?

Best regards,

Julien




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai] Posix vs Alchemy - multiplexing and registry
  2018-01-25 13:43 [Xenomai] Posix vs Alchemy - multiplexing and registry Julien Blanc
@ 2018-01-25 14:21 ` Philippe Gerum
  2018-01-25 15:14   ` Julien Blanc
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Gerum @ 2018-01-25 14:21 UTC (permalink / raw)
  To: Julien Blanc, xenomai

On 01/25/2018 02:43 PM, Julien Blanc wrote:
> Hi,
> 
> We have a xenomai 3 application currently using the alchemy API
> (application development started on xenomai 2.x).
> 
> We would like to add I/O multiplexing in some parts of the application.
> My understanding is that it is not supported by the alchemy API, so we
> would have to resort to the Posix API.
> 
> The downside is that by doing so, we lose the registry : with the posix
> api nothing is exported. We would like to access all this data, at
> least for debugging purposes (ideally, disable it in production build).
> 
> I couldnt find any pointer for doing either of the following :
> - enable the registry while using the posix API
> - multiplex using the alchemy api
> - retrieve a posix-api compatible file descriptor from an alchemy
> handle (which would allow a __cobalt_select call)
> 
> Is there some resources or something obvious that i'm missing ?
> 

There is no provision for I/O multiplexing with alchemy. Only the pipe
object embeds a RTDM file descriptor which could be passed to
libcobalt's select() implementation, other resources (e.g. queues,
buffers etc) don't.

I would suggest to enable the registry for your application (not for the
entire POSIX API), as you might not need each and every resource to be
exposed via a fuse-based fs.

To do so, you can link against libcopperplate, which is not documented.
However, looking at lib/alchemy/init.c may give you some hints about the
way to create your own registry hierarchy (see alchemy_init()). Then
looking at sections defined for CONFIG_XENO_REGISTRY in e.g. queue.c
would give you an illustration of a proper client-side usage, for
populating this hierarchy with object nodes, and the way to return
information back when those nodes are opened for reading.

-- 
Philippe.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai] Posix vs Alchemy - multiplexing and registry
  2018-01-25 14:21 ` Philippe Gerum
@ 2018-01-25 15:14   ` Julien Blanc
  2018-01-25 15:24     ` Philippe Gerum
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Blanc @ 2018-01-25 15:14 UTC (permalink / raw)
  To: xenomai

Le jeudi 25 janvier 2018 à 15:21 +0100, Philippe Gerum a écrit :
> On 01/25/2018 02:43 PM, Julien Blanc wrote:
> > 
> There is no provision for I/O multiplexing with alchemy. Only the
> pipe object embeds a RTDM file descriptor which could be passed to
> libcobalt's select() implementation, other resources (e.g. queues,
> buffers etc) don't.

Thanks for your answer. If i understand correctly, this also means that
it is not recommended to mix both APIs in the same program. For example
a queue created with rt_create_queue cannot be read with
__cobalt_mq_open, am I right ?

> I would suggest to enable the registry for your application (not for
> the entire POSIX API), as you might not need each and every resource
> to be exposed via a fuse-based fs.

This is something i'd rather avoid if possible. Though, thanks for the
pointers, at first glance it seems much simpler than what i feared.

Regards,

Julien


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai] Posix vs Alchemy - multiplexing and registry
  2018-01-25 15:14   ` Julien Blanc
@ 2018-01-25 15:24     ` Philippe Gerum
  0 siblings, 0 replies; 4+ messages in thread
From: Philippe Gerum @ 2018-01-25 15:24 UTC (permalink / raw)
  To: Julien Blanc, xenomai

On 01/25/2018 04:14 PM, Julien Blanc wrote:
> Le jeudi 25 janvier 2018 à 15:21 +0100, Philippe Gerum a écrit :
>> On 01/25/2018 02:43 PM, Julien Blanc wrote:
>>>  
>> There is no provision for I/O multiplexing with alchemy. Only the
>> pipe object embeds a RTDM file descriptor which could be passed to
>> libcobalt's select() implementation, other resources (e.g. queues,
>> buffers etc) don't.
> 
> Thanks for your answer. If i understand correctly, this also means that
> it is not recommended to mix both APIs in the same program. For example
> a queue created with rt_create_queue cannot be read with
> __cobalt_mq_open, am I right ?

Correct. One may use both POSIX and alchemy APIs in the same program
though, but calls referring to equivalent objects (e.g. sem, queue,
task/threads, etc) are not interchangeable. alchemy provides high-level
services built on basic POSIX calls.

> 
>> I would suggest to enable the registry for your application (not for
>> the entire POSIX API), as you might not need each and every resource
>> to be exposed via a fuse-based fs.
> 
> This is something i'd rather avoid if possible. Though, thanks for the
> pointers, at first glance it seems much simpler than what i feared.
> 

It is pretty simple, just not documented.

-- 
Philippe.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-25 15:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-25 13:43 [Xenomai] Posix vs Alchemy - multiplexing and registry Julien Blanc
2018-01-25 14:21 ` Philippe Gerum
2018-01-25 15:14   ` Julien Blanc
2018-01-25 15:24     ` Philippe Gerum

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.