[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:52:48 +0300 |
Dear Sylvain,
All my modules are RAW API including the WEB server.
Using critical section in pin point location is not wrong. Any other
implementation will
Have to use a more complicated queuing mechanism.
Complicated, maybe. Slower, maybe but not stupid, sorry :-)
BR,
Noam.
-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Sylvain Rochet
Sent: Thursday, June 04, 2015 3:45 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] memory leak ?
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
************************************************************************************
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.
************************************************************************************
- [lwip-users] memory leak ?, Noam weissman, 2015/06/03
- Re: [lwip-users] memory leak ?, Sergio R. Caprile, 2015/06/03
- Re: [lwip-users] memory leak ?, Noam weissman, 2015/06/03
- Re: [lwip-users] memory leak ?, Sergio R. Caprile, 2015/06/03
- Re: [lwip-users] memory leak ?, Noam weissman, 2015/06/03
- Re: [lwip-users] memory leak ?, Noam weissman, 2015/06/04
- Re: [lwip-users] memory leak ?, Noam weissman, 2015/06/04
- Re: [lwip-users] memory leak ?, Jan Menzel, 2015/06/04
- Re: [lwip-users] memory leak ?, Krzysztof WesoĊowski, 2015/06/04
- Re: [lwip-users] memory leak ?, Sylvain Rochet, 2015/06/04
- Re: [lwip-users] memory leak ?,
Noam weissman <=