lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Question about thread safety


From: Simon Goldschmidt
Subject: Re: [lwip-users] Question about thread safety
Date: Thu, 24 Jan 2013 21:19:18 +0100

Louis Wells wrote:

> I have a thread set up for tcpip, and another thread that is running a sort 
> of main lwip task, which is used to determine whether or not my board is 
> plugged into a network and use dhcp, or if no network is accessible and my 
> board should act as a server to dole out an ip address to a directly 
> connected laptop. 

I'm not sure I fully understand your threading setup, but maybe it helps if I 
repeat on lwIP's threading requirements:

- only a specific subset of the functions may be called from another thread 
than tcpip_thread
- As you said, when accessing internal functions from another thread, you must 
use tcpip_callback.
- especially the raw API functions (tcp.h, UDP.h, etc) must not be called from 
other threads.
- callback functions from the raw api are always called from tcpip_thread by 
lwIP, so you can call into the stack without tcpip_callback from there.

Hope that helps.

Simon


reply via email to

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