Signal handler & mutex, condition

Marek Prochazka Marek.Prochazka at scisys.co.uk
Thu Jun 8 10:01:27 UTC 2006


> > In POSIX, I know that in general it is unsafe to use mutex or 
> > condition
> > within an asynchronous signal handler. Does RTEMS have a more 
> > precisely
> > defined policy on that? In other words, is anyone able to tell me
what
> > exactly is unsafe and whether some sort of a safe restricted use of
a
> > condition/mutex is possible?

> The RTEMS manual explains which RTEMS primitives are safe
> to call from (RTEMS) interrupt handlers. If you are using
> the POSIX interface, you will need to figure out which
> RTEMS primitives a given POSIX primitive is using, and then
> check that all of them are safe.

The POSIX implementation uses the rtems_timer_create primitive. The
RTEMS manual says that "Timer service routines may perform any
operations or directives which normally would be performed by the
application code which invoked the rtems_clock_tick directive".

I also assume that the timer implementation uses asynchronous signal
routines (ASRs). The RTEMS manual however says that "ASRs execute in the
context of a task and may execute any directive."

My interpretation of this is that I do not have to worry about the use
of mutexes and conditions in a timer service routine (and hence a POSIX
timer callback). Any thoughts on this, please?

Thanks,
Marek




More information about the users mailing list