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: Lan Yang
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 16:34:37 +0800

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




CONFIDENTIALITY NOTICE: The contents of this email and any attachments are intended solely for the addressee(s) and contain confidential and/or privileged information and are legally protected from disclosure unless otherwise indicated. If you received this message by mistake, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited.  

reply via email to

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