ip stack mutual exclusion

Eric Norum eric at cls.usask.ca
Wed Jan 19 22:17:31 UTC 2000


Fermi at aol.com wrote:
> 
> I am adding a security association database to the
> RTEMS IP-stack to support IPSEC.
> 
> I would like to run RTEMS with a
> thread time slice, but a thread that is acessing the database when its time quantum expires might leave
> it in an unstable state.
> 
> In unix to suport mutual exclusion a programmer raises and then replaces the interupt levels with calls to spl***() and splx().
> 
> RTEMS has #defined spl***() and splx() to do nothing.
> 
> How can I support a mutual exclusion in the RTEMS IP stack? Will a semaphore work?

The RTEMS network code is already thread-safe.  There is a single mutex
which must be held before a task can be active in the network code.  One
of the beneficial side-effects of adding this mutex to the FreeBSD code
was that all the splx routines could be defined to do nothing thus
ensuring that the network stack did not add anything to the interrupt
latency for real-time applications.

This is all described in the RTEMS Network Supplement documentation.
-- 
Eric Norum                                 eric at cls.usask.ca
Canadian Light Source                      Phone: (306) 966-6308
University of Saskatchewan                 FAX:   (306) 966-6058
Saskatoon, Canada.



More information about the users mailing list