lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] memory leak ?


From: Sylvain Rochet
Subject: Re: [lwip-users] memory leak ?
Date: Thu, 4 Jun 2015 14:45:07 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hello Jan,

On Thu, Jun 04, 2015 at 02:34:39PM +0200, Jan Menzel wrote:
> Hi Noam!
>       From earlier discussion on this list, I learned that for this purpose
> one may schedule a callback into the LWIPs internal task using
> tcpip_callback() or tcpip_callback_with_blocking(). Both queue your
> function and its arguments for execution from within the main Lwip task
> context. I'm not sure if this is applicable here, but if so, I would
> favour the callback solution as yours might introduce dead locks in case
> tcp_sndbuf() blocks. This type of errors are comparably difficult to
> find and likely to happen if eg. an other task is used to free buffers
> after transmission completed.

You are right.

For future readers which might looks at this thread in the hope of 
getting a clue, please don't get fooled !, what Noam is doing is 
completely wrong. Adding a critical section and playing with thread 
priority this way is either dangerous or just stupid. (And don't tell me 
that it is working, I don't care if it -appears- to work).

OS users HAVE TO use the Netconn or Socket API if they want to call lwIP 
functions from others threads, period. RAW API is ***NOT*** thread-safe.

I repeat, RAW API is ***NOT*** thread-safe.

Sylvain

Attachment: signature.asc
Description: Digital signature


reply via email to

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