public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Nick Garnett <nickg@cygnus.co.uk>
To: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] bypass DSR, sem_post from ISR
Date: Fri, 25 May 2001 03:15:00 -0000	[thread overview]
Message-ID: <wwgvgmpoi3o.fsf@balti.cambridge.redhat.com> (raw)
In-Reply-To: <20010524202755.43465.qmail@web12101.mail.yahoo.com>

Phung Te Ha <phungte@yahoo.com> writes:

> Hi everyone,
> 
> I have an interrupt handling which needs reschedule
> (cyg_thread_delay and mutex_lock) so I have the real
> service in a thread.
> 
> My question is that is it safe to call cyg_sem_post
> directly from the ISR and start my service thread
> rather than start the DSR and wait for this one to
> call cyg_sem_post?
> 

No, you cannot do that. Interrupts are allowed at any time even when
the kernel is in the middle of a thread switch and the scheduler data
structures are inconsistent. Calling any function in an ISR that might
also try to manipulate the same data would result in unpredicatable
behaviour.

Do not worry about the performance of the DSR mechanism. It is at
least as efficient as any other mechanism we might have chosen to
solve these problems, and a good deal more efficient than some.

-- 
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK

      parent reply	other threads:[~2001-05-25  3:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-24 13:28 Phung Te Ha
2001-05-25  3:01 ` Hugo Tyson
2001-05-25  3:15 ` Nick Garnett [this message]

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=wwgvgmpoi3o.fsf@balti.cambridge.redhat.com \
    --to=nickg@cygnus.co.uk \
    --cc=ecos-discuss@sources.redhat.com \
    /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).