public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Goldschmidt Simon" <sgoldschmidt@de.pepperl-fuchs.com>
To: <ecos-discuss@ecos.sourceware.org>
Subject: [ECOS] why is it wrong to call cyg_semaphore_post() in ISR???
Date: Tue, 20 Jun 2006 12:52:00 -0000	[thread overview]
Message-ID: <651FDF993328694286BDDA6A0A3606B912E14E@pfde-mx5.EU.P-F.BIZ> (raw)

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

             reply	other threads:[~2006-06-20 12:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-20 12:52 Goldschmidt Simon [this message]
2006-06-20 13:12 ` Andrew Lunn
2006-06-20 15:47   ` [ECOS] " Grant Edwards
  -- strict thread matches above, loose matches on Subject: below --
2006-06-08 17:39 [ECOS] " Monica Dsz
2006-06-08 18:06 ` Gary Thomas
2006-06-09  7:23   ` Monica Dsz
2006-06-09  9:19   ` Monica Dsz
2006-06-09  9:27     ` Andrew Lunn
2006-06-09  9:43       ` Monica Dsz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=651FDF993328694286BDDA6A0A3606B912E14E@pfde-mx5.EU.P-F.BIZ \
    --to=sgoldschmidt@de.pepperl-fuchs.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).