lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] LPC1768/9 LAN8720 FreeRTOS 7.4 LWIP 1.4.1


From: Furiantes
Subject: Re: [lwip-users] LPC1768/9 LAN8720 FreeRTOS 7.4 LWIP 1.4.1
Date: Sat, 01 Jun 2013 21:08:48 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130509 Thunderbird/17.0.6

Thanks to ALL for all answers for now, I managed netconn to get work and even tiny webserver on (netconn TCP).

Dne 24.5.2013 10:42, piše Sylvain Rochet:
Hi,


On Fri, May 24, 2013 at 07:35:49AM +0200, Furiantes Furiantes wrote:
Is tcp_new() thread safe too ? or just netcon. My scenario is that:
No, as said in doc/rawapi.txt :-)


Raw API is *NOT* thread safe: udp_*(), tcp_*(), netif_*(), ...

Netconn API is thread safe: netconn_*()
Socket API is thread safe: lwip_accept(), lwip_bind(), lwip_connect(), ...
NetifAPI is thread safe: netifapi_*()


- i will call a TCP staff only in seperated threads. Like do_download =
tcp_new() in one thread and than like listen to some port initialized in
seperated thread etc. etc.

Is that ok to do or not ? With global access can I access from TCP_1 thread
to TCP_2 thread like TCP_2 kill TCP_1 thread.
Nah, this is wrong, you *have to* use netconn or socket API.


Also, and this is very important too, Netconn and Socket API are thread 
safe against lwIP thread but NOT against themselves, so a UDP or a TCP 
PCB must be handled by only one thread. If you want to share a PCB 
between threads you can of course add the necessary mutex around Netconn 
or Socket calls.


Sylvain


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


reply via email to

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