Waking up a linux thread from a xenomai thread, without mode switch

Philippe Gerum rpm at xenomai.org
Fri Dec 14 16:06:16 CET 2018

On 12/14/18 2:16 PM, Julien Blanc wrote:
> Le vendredi 14 décembre 2018 à 12:07 +0100, Philippe Gerum a écrit :
>> You could use non-rt Xenomai threads on the linux side with policies
>> SCHED_FIFO+prio=0 or SCHED_WEAK, allowing the thread to issue
>> blocking
>> Xenomai syscalls (such as waiting on a Cobalt sema4).
>> But, since this would incur two mode switches for the caller - one to
>> switch to primary, then a converse switch to relax when returning
>> from
>> the blocking syscall - you certainly don't want to use that method in
>> high-frequency loops, because this would be very costly CPU-wise.
> Do you mean, using a third thread acting as a proxy, so that the
> xenomai thread never leaves the primary domain ?

You need no proxy, if what you call the "linux" thread is in fact a
Xenomai thread undergoing Xenomai "weak" scheduling policy. It would run
in secondary mode except when calling into the rt core for waiting for a
rt event.


More information about the Xenomai mailing list