On 06/08/2016 11:56 AM, Alex Plits wrote:
> 
> 
>> -----Original Message-----
>> From: Philippe Gerum [mailto:r...@xenomai.org]
>> Sent: Thursday, June 02, 2016 4:12 PM
>> To: Alex Plits; xenomai@xenomai.org
>> Subject: Re: [Xenomai] XDDP NRT to RT communication and select
>>
>> On 05/11/2016 08:58 AM, Alex Plits wrote:
>>> Hi,
>>>
>>> We require communication between non-real time and real time thread in
>>> xenomai 3.x, so naturally we planned to use XDDP.
>>> After careful read and looking into examples in smokey we tried to
>>> implement simple communication Between NRT thread that sends via RTP
>>> pseudo device a buffer to RT thread which is blocked on xenomai
>>> "select" (read_fds) based on a ripped example of XDDP in smokey (without
>> 2nd real time thread), i.e. NRT thread periodically sends messages to the RT
>> thread waiting on select before actual receive call.
>>> Unfortunately the "select" call on the RT thread was never triggered -
>>> although in the smokey unit test it worked as expected, the only difference
>> was the 2nd real time thread (which we got rid of in our case) used "sendto"
>> call to that XDDP socket.
>>> After some xenomai code examination we saw that XDDP send/recv
>>> functions do signal xenomai select waiters which explains the smokey case
>> (sendto triggered select) but It seems (correct me if I'm wrong) that
>> xnpipe_write/read do not.
>>> In order to confirm that we used "xnselect_signal" to trigger the xenomai
>> select waiters in the "__xddp_input_handler" callback that is called inside
>> xnpipe_write and this seemed to work.
>>> So my queries are -
>>>
>>> 1.       Does XDDP mechanism support select call for NRT writers  - or did 
>>> we
>> misread https://xenomai.org/2014/08/porting-a-linux-application-to-
>> xenomai-dual-kernel/#IO_multiplexing_with_select?
>>>
>>
>> That was the plan, but as you noticed, the implementation was broken,
>> spuriously connecting the rt output to the rt input instead.
>>
>>> 2.       Will the opposite direction work i.e. RT-> NRT that is waiting on a
>> select?
>>>
>>
>> Yes, this is a separate code path, which works fine.
>>
>>> 3.       Is the small patch we added acceptable for the case described 
>>> above /
>> is there any additional locking that we need to handle?
>>>
>>
>> I don't know the exact implementation of your fix, but this should indeed 
>> live
>> in the pipe input handler from the XDDP protocol module.
>> Conversely, the corresponding code has to be removed from
>> __xddp_sendmsg().
>>
>> http://git.xenomai.org/xenomai-3.git/commit/?h=stable-
>> 3.0.x&id=fd828bf38f2c7ba5140cbbf1ae932a5e184f823f
>>
> [Alex Plits] 
> Hi Philippe, 
> That seems to be the exact fix we have tried and indeed this solved the 
> select issue on the XDDP socket. 
> However this was part of our requirement - in addition to waiting on the XDDP 
> socket RT part, in the select call
> we required a wait on a posix(RT) message queue descriptor and this yield 
> strange behavior, long story short - this does not work as expected although 
> using
> select on each of them apart works fine.
> i.e. 
> Select on the posix(RT) Qs -> works as expected
> Select on the XDDPs after fix -> works as expected
> Select on FD_SET where Posix(RT) Q descriptor is set and XDDP socket 
> descriptor is set -> broken.
> 
>>From what we understand in the documentation mentioned in previous post this 
>>should work. 
> Can you advise?

Please send me a simple test case.


-- 
Philippe.

_______________________________________________
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai

Reply via email to