Skip to contentSkip to conversation

Question about synchronisation between xenomai task and linux task

Xenomai ニャン星人 2 participants 4 messages Dec 14, 2015 – Dec 15, 2015

lore
Share & tools
lore
#0 lore raw

Hello, sorry to bother you. I have some questions about synchronisation. I am very eager for your help.

I have read the source code file like rtipc.c, xddp.c, bufp.c, iddp.c, and pipe.c. Now I am wondering if there is a simple and effective way of synchronisation between xenomai task and linux task in user space and kernel space.

I found most of synchronisation service introduced in Xenomai 3 Programmer’s Reference Manual could be only used in xenomai task, linux task can not use these synchronisation service. If I use linux synchronisation service like mutex in xenomai task, xenomai task would switch to secondary mode which would cost a lot of time. So I want to know how to synchronize xenomai task and linux task in user space.
o

As I mentioned above, I have read the source code file like rtipc.c, xddp.c, bufp.c, iddp.c, I know lots of functions were realized in linux kernel modules as rtdm devices, both xenomai task and linux task could call these functions by rtdm interface. In kernel space, Synchronisation Services was used to synchronize between xenomai tasks, xnapc and wait_queue_head_t were used to synchronize between xenomai task and linux task. I am wondering if there is a simple to synchronize between xenomai task and linux task directly in kernel space.

I'am a rookie of xenomai. It might be simple questions in your opinion. I would appreciate it if you could help.

#1 lore raw
Quoted 30 lines · ニャン星人

Hello, sorry to bother you. I have some questions about synchronisation. I am very eager for your help.

I have read the source code file like rtipc.c, xddp.c, bufp.c, iddp.c, and pipe.c. Now I am wondering if there is a simple and effective way of synchronisation between xenomai task and linux task in user space and kernel space.

I found most of synchronisation service introduced in Xenomai 3 Programmer¡¯s Reference Manual could be only used in xenomai task, linux task can not use these synchronisation service. If I use linux synchronisation service like mutex in xenomai task, xenomai task would switch to secondary mode which would cost a lot of time. So I want to know how to synchronize xenomai task and linux task in user space. o

As I mentioned above, I have read the source code file like rtipc.c, xddp.c, bufp.c, iddp.c, I know lots of functions were realized in linux kernel modules as rtdm devices, both xenomai task and linux task could call these functions by rtdm interface. In kernel space, Synchronisation Services was used to synchronize between xenomai tasks, xnapc and wait_queue_head_t were used to synchronize between xenomai task and linux task. I am wondering if there is a simple to synchronize between xenomai task and linux task directly in kernel space.

Quoted 2 lines

I'am a rookie of xenomai. It might be simple questions in your opinion. I would appreciate it if you could help.

The xddp sockets allow exchanging message between Xenomai and Linux threads. Synchronizing per-se is complicated because the two types of threads are scheduled by different schedulers.

Quoted 3 lines

_______________________________________________ Xenomai mailing list [email protected]
http://xenomai.org/mailman/listinfo/xenomai

Signature · 2 lines
					    Gilles.
https://click-hack.org
#2 lore raw

[Xenomai] 回复: Question about synchronisation between xenomai taskand linux task

So you mean there is not simple and complete solution way apply by xenomai to figure out the synchronization problem between xenomai thread and linux thread? When I meet synchronization problem between xenomai thread and linux thread, do I have to handle it like xddp and pipe?

------------------ 原始邮件 ------------------
发件人: "Gilles Chanteperdrix"<[email protected]>;
发送时间: 2015年12月15日(星期二) 上午6:35
收件人: "ニャン星人"<[email protected]>;
抄送: "xenomai"<[email protected]>;
主题: Re: [Xenomai] Question about synchronisation between xenomai taskand linux task

Quoted 30 lines · ニャン星人

Hello, sorry to bother you. I have some questions about synchronisation. I am very eager for your help.

I have read the source code file like rtipc.c, xddp.c, bufp.c, iddp.c, and pipe.c. Now I am wondering if there is a simple and effective way of synchronisation between xenomai task and linux task in user space and kernel space.

I found most of synchronisation service introduced in Xenomai 3 Programmer¡¯s Reference Manual could be only used in xenomai task, linux task can not use these synchronisation service. If I use linux synchronisation service like mutex in xenomai task, xenomai task would switch to secondary mode which would cost a lot of time. So I want to know how to synchronize xenomai task and linux task in user space. o

As I mentioned above, I have read the source code file like rtipc.c, xddp.c, bufp.c, iddp.c, I know lots of functions were realized in linux kernel modules as rtdm devices, both xenomai task and linux task could call these functions by rtdm interface. In kernel space, Synchronisation Services was used to synchronize between xenomai tasks, xnapc and wait_queue_head_t were used to synchronize between xenomai task and linux task. I am wondering if there is a simple to synchronize between xenomai task and linux task directly in kernel space.

Quoted 2 lines

I'am a rookie of xenomai. It might be simple questions in your opinion. I would appreciate it if you could help.

The xddp sockets allow exchanging message between Xenomai and Linux threads. Synchronizing per-se is complicated because the two types of threads are scheduled by different schedulers.

Quoted 3 lines

_______________________________________________ Xenomai mailing list [email protected]
http://xenomai.org/mailman/listinfo/xenomai

Signature · 2 lines
					    Gilles.
https://click-hack.org
#3 lore raw

Re: [Xenomai] 回复: Question about synchronisation between xenomai taskand linux task

Quoted 5 lines · ニャン星人

So you mean there is not simple and complete solution way apply by xenomai to figure out the synchronization problem between xenomai thread and linux thread? When I meet synchronization problem between xenomai thread and linux thread, do I have to handle it like xddp and pipe?

The solution which strictly does what you want is xddp. (rt_pipe is deprecated, and linux pipes will cause both ends to switch to secondary mode).

But you may consider using a Xenomai only synchronization primitive (such as semaphores, message queues, etc...), and have the non real-time thread be a Xenomai thread oscillating between primary and secondary mode. Using the SCHED_OTHER or SCHED_WEAK policy for such a thread should help.

Signature · 2 lines
					    Gilles.
https://click-hack.org