lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] mutex API in system layer is necessary ?


From: Mason
Subject: Re: [lwip-users] mutex API in system layer is necessary ?
Date: Thu, 10 May 2012 16:03:59 +0200
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20120429 Firefox/12.0 SeaMonkey/2.9.1

Simon Goldschmidt wrote:

> "Define LWIP_COMPAT_MUTEX if the port has no mutexes and binary
> semaphores should be used instead". The only disadvantage of using
> binary semaphores (in this case, the sys_mutex_* functions are
> defined to their sys_sem_* substitute) is that you can get priority
> inversion (mutextes are only used for communication between API tasks
> using netconn or sockets and the tcpip_thread).

AFAIU, mutexes do not make a system immune to priority inversion.

Consider 3 processes of increasing priority L, M, H.

Suppose L locks a mutex; then H waits for the mutex; then M starts
running and preempts L : H will never run, as long as M runs.

Unless you were thinking of specific implementations of mutexes
(priority mutexes) which temporarily boost the priority of tasks
that lock that specific mutex?

-- 
Regards.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]