lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] LwIP v2.1.2 in UDP client mode gets stuck in etharp_que


From: Peter
Subject: Re: [lwip-users] LwIP v2.1.2 in UDP client mode gets stuck in etharp_query() after running for a long time without connection?,
Date: Sat, 24 Sep 2022 11:47:27 +0100

One needs to be careful with thread safety because stuff can
apparently work for a long time, and then breaks when timing changes.

Netconn should be thread safe if different RTOS tasks use different
handles. It's a bit like serial ports; they will never be thread safe
(obviously).

LWIP achieves thread safety by using internal messaging, which is
atomic.

That is my understanding.

>On Fri, 23 Sep 2022 11:04:55 +0100   Peter <peter@peter2000.co.uk>    wrote:
>
>>
>> I have been told by an "expert" that the RAW API is *never* thread
>> safe.
>>
>> The core locking feature is just a more timing-efficient way of doing
>> things, but the LWIP netconn and sockets APIs are thread-safe anyway.
>>
>>
>Hi Peter,
>
>I'm glad to hear from you.
>
>
>I've found a raw function that is thread safe:  tcpip_try_callback()
>function.
>
>Though according to the doc:
>https://www.nongnu.org/lwip/2_1_x/multithreading.html,
>only the functions from these API header files are thread-safe: api.h,
>netbuf.h, netdb.h, netifapi.h, pppapi.h, sockets.h, sys.h.
>
>I saw a note above the tcpip_try_callback() function, it said that the
>function can be called in interruption. However,  tcpip_try_callback()
>function is not in the API header files mentioned above!
>
>Maybe it's because the maintenance of the docs is a bit behind the updates
>to the code. I think we should go with source code and actual test results.
>
>
>Netconn is not always thread safe.
>Suppose there are two threads and one netconn, one thread receives through
>this net conn while another thread sends through this net conn, in this
>case netconn is not thread safe.
>More details can be seen in this link:
>https://lists.gnu.org/archive/html/lwip-users/2009-05/msg00049.html
>
>
>Last but not least, when you send an email to the lwip-user mail list,
>please follow these steps:
>1. Edit the contacts to "lwip-users@nongnu.org"
>2. Edit the subject to the thread title that you want to join in or reply
>to. (This can make your mail be archived in the mail list in the same
>subject.)
>3. Clear the content of the email if you send a new email by clicking the
>reply button. (This can make your email more readable.)
>4. Just write what you want to write and send it.
>Please don't reply to the lwip-users Digest mail directly or use a subject
>name just like "lwip-users Digest, Vol 229, Issue 13". It's confusing a lot.
>
>
>If my understanding is different from yours, exchange of ideas is very
>welcome.
>
>Best regards,
>Lan



reply via email to

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