lwip-devel
[Top][All Lists]
Advanced

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

RE : [lwip-devel] [task #7068] lwIP docs: Update, improve, add documenta


From: Goldschmidt Simon
Subject: RE : [lwip-devel] [task #7068] lwIP docs: Update, improve, add documentation about using lwIP
Date: Tue, 10 Jul 2007 15:29:08 +0200

> >I don't like the idea of needing semaphores AND mutexes as 
> long as it 
> >can be done different.
> 
> A future need will be to have a socket layer "extension" to 
> enable to handle "inputs" like with RAWAPI. These callbacks 
> could call lwip_send to response to "inputs", but with a LOCK 
> based on semaphore, you will have a dead-locking since the 
> callback has already "lock" the core, and lwip_send will do. 
> With a mutex, no such problem. We could propose to "unlock" 
> before calling the application callback, but in this case, 
> you could be "interrupted" by another thread. That why I 
> think it will be good to use mutex. More, if you have 
> SYS_LIGHTWEIGHT_PROT=1, your sys_arch_protect is perhaps 
> implemented on a mutex (since this call have to support 
> recursive calls). Problem, with sys_arch_protect, you can't 
> decide which "lock" you use...
> 

Thinking about semaphores and mutexes: Maybe it's not that bad
to have both, after all: sockets.c and mem.c would benefit of
having mutexes instead of semaphores, I think. In fact, with
the current code, we could convert all semaphores to mutexes!




reply via email to

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