From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hugo Tyson To: "eCos Disuss" Subject: Re: [ECOS] mutex operation Date: Tue, 03 Jul 2001 06:57:00 -0000 Message-id: References: X-SW-Source: 2001-07/msg00074.html "Andy Simpkins" 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