This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: mutex operation



"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]