lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #21433] Calling mem_free/pbuf_free from interrupt cont


From: Simon Goldschmidt
Subject: [lwip-devel] [bug #21433] Calling mem_free/pbuf_free from interrupt context isn't safe
Date: Fri, 26 Oct 2007 15:51:32 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8

Follow-up Comment #5, bug #21433 (project lwip):

Personally, I don't know what to prefer here.

- Using SYS_ARCH_PROTECT to walk the heap seems like a bad idea to me, since
_my_ heap is pretty big, this locks interrupts for too long.

- Using the chained list we have to implement many new functions (lock/unlock
a resource for NO_SYS=1, sys_sem_tryget for NO_SYS=0), the code is rather
slower (but the mem_* functions are slow, anyway) _and_ it adds unused code
for people that don't need it.

- tcpip_callback makes the stack dependent on the API part and we need to
malloca a memp-message when we want to free memory (seems a little big awkward
to me).

It _does_ work with NO_SYS=1, though: you only have to implement a function
called tcpip_callback that puts function calls and their arguments into a
linked list and process that list when back in normal context (poll it like
the rest of the stack). Of course, that would also be code not needed by most
of the people. 

The reason I prefer the list (like in my patch) is it just works (provided we
have the necessary functions and the port is correct) independent of the
context mem_free() is called from, which makes lwIP easier to implement.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?21433>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

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