This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: bypass DSR, sem_post from ISR
- To: ecos-discuss at sources dot redhat dot com
- Subject: Re: [ECOS] bypass DSR, sem_post from ISR
- From: Nick Garnett <nickg at cygnus dot co dot uk>
- Date: 25 May 2001 11:09:31 +0100
- Newsgroups: cygnus.sourceware.ecos.d
- Organization: Red Hat UK
- References: <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