This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
why is it wrong to call cyg_semaphore_post() in ISR???
- From: "Goldschmidt Simon" <sgoldschmidt at de dot pepperl-fuchs dot com>
- To: <ecos-discuss at ecos dot sourceware dot org>
- Date: Tue, 20 Jun 2006 14:48:55 +0200
- Subject: [ECOS] why is it wrong to call cyg_semaphore_post() in ISR???
Hi,
>> Normally, you try not to disable interrupts in RTOS's. You should
>> protect your critical regions with mutex's, semaphores etc.
>>
That might be true if minimal interrupt latency is your main goal. But if you have to get the best performance out of your hardware, disabling interrupts seems faster to me than using mutexes...
>
>I remember well that I(we in our company) have used intLock () in
>VxWorks to make sure that interrupt doesnt during some critical
>sections. Ofcourse we did use semaphores and mutexes to guard against
>other threads but as far as I remember i never used semaphores/mutexes to guard against interrupts.
>
> lockKey = intLock ();
>
> ... (work with interrupts locked out)
>
> intUnlock (lockKey);
That's how we do it with µC/OS.
>Seems in eCos we dont need to disable interrupts because interrupts
>doesnt perform any kernal calls and we can use DSR to give semaphores
>and etcthank you
Any idea what the performance loss is by using ISR+DSR instead of ISR only?
We are using NIOS-II processor and any context switch avoided makes our system a lot faster!
Thanks,
Simon.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss