lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] memory leak ?


From: Noam weissman
Subject: Re: [lwip-users] memory leak ?
Date: Thu, 4 Jun 2015 15:18:43 +0300

Hi,

PROBLEM SOLVED :-)

As mentioned earlier by Sergio we should not call LwIP code from within
other threads.

I must call tcp_write and other functions from a separate thread. This
is the implementation. 

My TCP stack has the highest task priority in the system.  As a result
calling tcp_write or any other
LwIP function may cause unpredictable LwIP internal code problems.

I added  taskENTER_CRITICAL(); and taskEXIT_CRITICAL(); 
Function calls to the portion of code that call tcp_write etc.. this
synchronizes the threads 
Interaction and solved the problem I faced completely.

For example:

      taskENTER_CRITICAL();
      {
          AvailableSpace = tcp_sndbuf(ts->pcb);
      }
      taskEXIT_CRITICAL();


Thanks for your insight.

BR,
Noam. 

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Sergio R. Caprile
Sent: Thursday, June 04, 2015 12:02 AM
To: address@hidden
Subject: Re: [lwip-users] memory leak ?

Tx: yes
Rx: if you free them properly then they shouldn't be scarce. Have you
tested this ?

I'm not familiar with lwIP under RTOS except that you must adhere to the
general rule of not calling the stack from different threads.
You should check your port with a known good application first. Try
echo, for example, or netio; both are available in the contrib tree (and
there is nice patch for netio sent by youknowho)


_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users

 
 
************************************************************************
************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals &
computer viruses.
************************************************************************
************






************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer 
viruses.
************************************************************************************






reply via email to

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