[Top][All Lists]

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

Re: [lwip-users] Reentrency problem within mem.c module

From: address@hidden
Subject: Re: [lwip-users] Reentrency problem within mem.c module
Date: Thu, 25 Oct 2007 17:55:21 +0200
User-agent: Thunderbird (Windows/20070728)

Jonathan Larmour schrieb:
I think doing a tcpip_callback() call (or something similar), so the tcpip
thread handles it, would be smaller and simpler. (Of course for NO_SYS==1,
you can just call pbuf_free directly since there should only be one context
in lwIP as it is).
That's the problem: you can't simply call pbuf_free directly because you could be sending a packet at non-interrupt level while trying to free a pbuf at TX interrupt level!

For NO_SYS==0, I favour your tcpip_callback since the interrupt function doesn't need to walk the heap and thus is faster. But I would favour a solution that solves this problem for both NO_SYS settings...

Perhaps pbuf_free() is a sufficiently common operation for this sort of
thing, that we could make a new pbuf_free_safe() call or something, which
either calls pbuf_free() (NO_SYS==1) or tcpip_callback to call pbuf_free
pbuf_free_safe() would be enough in this situation, but since memp_free is the problem (no pbuf_free()),
I think memp_free_safe() would be better since it is more generic.


reply via email to

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