Signal handler & mutex, condition

Sergei Organov osv at javad.com
Wed Jun 28 10:32:21 UTC 2006


"Marek Prochazka" <Marek.Prochazka at scisys.co.uk> writes:
> Hi,
>
>>>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."
>>
>> You would have assumed badly especially since you could have read
>> the source code.
>> 
>> Regular TSRs are invoked as part of processing the clock tick
>> interrupt handler and thus execute outside the context of any
>> task/thread.
>
> thanks for the reply - I haven't have time to investigate more and
> look into the source code. The documentation is somewhat unclear in
> this respect.
>
>>>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?
>>
>> You do have to worry about them -- you can't block at all during a
>> TSR.
>
> O.K., but the problem is that RTEMS doesn't implement the SIGEV_THREAD
> way of implementation (as far as I know), so it is hard to use timers
> for many types of applications as the execution environment for signal
> handlers is too restrictive.

Nothing prevents you from starting your own thread(s) waiting for
event(s) from timer(s) and then doing whatever you wish in thread
context, and it's not that hard I believe.

-- 
Sergei.




More information about the users mailing list