[Xenomai] context switch minimize

Philippe Gerum rpm at xenomai.org
Thu Jul 5 15:05:10 CEST 2018


On 07/05/2018 11:37 AM, jimmyo wrote:
> Hello,
> 
> we have a running system on mx6 with Kernel 3.10.x and Xenomai 2.6.4.
> i known, it's very old.
> now we have to make some optmization.
> In one xenomai task we need to check, if a TCP/UDP socket handle has
> data to receive.
> at this time we use select to detect if there are data available and with
> ioctl & FIONREAD we get count of data.
> 
> Now we must search a way, to do this in the primary domain, without
> switching to secondary domain.
> 
> Is there a way to solve it ?
> 
> we have a exists rtdm interface to a own kernel module.
> And we use rt_dev_ioctl to communicate with this module.
> 

A plain thread could select() these file descriptors in userland,
posting a Xenomai-managed semaphore which your rt thread would trywait() on.

- semaphores can be posted by any thread, including those unknown to Xenomai
- sem_trywait() would poll for the event without switching mode.

-- 
Philippe.



More information about the Xenomai mailing list