lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [task #7212] Add Mutex concept in sys_arch


From: Frédéric Bernon
Subject: [lwip-devel] [task #7212] Add Mutex concept in sys_arch
Date: Tue, 21 Aug 2007 18:21:51 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6

Follow-up Comment #2, task #7212 (project lwip):

>Yes mutexes might help, although not all systems have recursive mutexes. I'm
interested to see that recursive mutexes are in SUS2. They are not in POSIX
1003.1c-1995, so they aren't that portable in practice.

Yes, but since it would be defined in sys_arch.c, for OS without native
reentrant mutexes, ports maintainers can implement reentrance like in the unix
port, right? So, I think we can integrate this concept.

>The problem with mutexes in some places like the memp code is that, for
example, you may be doing a pbuf_alloc(PBUF_POOL,... from an interrupt context
(due to a new incoming packet), and in an interrupt context you cannot block.
Which means you can't block on a mutex.

I suppose the solution I use is the same for most of developers: I got a
Rx-Task which wait a Rx-event. The Rx-Interrupt disable the RX interruption,
and signal the Rx-event. So, the Rx-Task is wake-up, process all incoming
packets, put them in PBUF_POOL, and last, enable the RX interruption. It allow
to process in the thread the job the IT should do (a kind of DPC instead of
ISR processing).


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?7212>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

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