This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: mutex operation
- To: "eCos Disuss" <ecos-discuss at sourceware dot cygnus dot com>
- Subject: Re: [ECOS] mutex operation
- From: Hugo Tyson <hmt at redhat dot com>
- Date: 03 Jul 2001 14:55:55 +0100
- References: <NEBBKCPHAKKLBOKILBONOEGBCDAA.Andy.Simpkins@TardisMobile.com>
- Reply-To: "eCos Disuss" <ecos-discuss at sourceware dot cygnus dot com>
"Andy Simpkins" <Andy.Simpkins@TardisMobile.com> writes:
> Just a short question on the use of Mutexes as the documentation does not
> seem clear...
>
> If I use a mutex to protect a resource in both a thread and inside a DSR
> will the eCos scheduler promote the thread's priority to greater than
> that of the DSR in the event that the thread has locked the resource and
> the DSR is waiting on that resource?
Nope. You must not use a mutex within a DSR, because attempting to acquire
the mutex can cause the caller to block. DSRs must not block.
Priority does not really apply to DSRs and interrupts:
All interrupts (ISRs) (when enabled and unmasked) have higher priority than
all DSRs and all threads.
All DSRs have higher priority than all threads.
Threads have numerical priority amongst themselves.
Depending on hardware implementation, interrupts might have a numerical
proprity amongst themselves - more often it is fixed by the hardware.
DSRs are just all run in arbitrary order as soon as possible, as soon as it
is safe to do so.
HTH,
- Huge