lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] UDP socket thread safe problem


From: Darius Babrauskas
Subject: Re: [lwip-users] UDP socket thread safe problem
Date: Tue, 3 Apr 2012 10:29:19 +0300

Hello,
 
I found, that 2  threads  A and B  used  same  systimeout. So it was not directly LWIP problem.
After correcting error, all working Ok. Closed.
 
Darius
----- Original Message -----
Sent: Thursday, February 23, 2012 11:34 AM
Subject: [lwip-users] UDP socket thread safe problem

Hello,
 
I have old project with LWIP v.1.2. for AVR32.
 
Problem:
 
2  threads  A and B . Each treads have 1 UDP socket with No( 0 and 1 ).  Each thread have self timeout struct.
 
Each socket using lwip_select function for detect receive data and timeouts. A thread using 1 second timeout, B using 10 seconds timeout.
 
 
Problem:
A or B thread  corrupting timeouts other thread.  If working one thread (or other sleeping) then all ok.  But if both tread using lwip_select, then timeouts begun work strange. Example.: B timeout  must be 10 second, but it triger after  1 second  , then 5 times 10seconds, then  9 seconds or 14 seconds. A timeouts receiving real data, but timeout  begun sometimes 0-1ms. So, data not received, because real must about after  60ms.
 
I found like post.
 
 

"conn->callback is called from api_msg.c in the core-receive-callbacks (recv_raw/recv_udp/recv_tcp) but also from netconn_recv, when data was received by the

application. This is definitively not thread-safe. "

I understud that it old version. Porting last lwip version - possible more problems.

So.  What advise? (maybe need use in one thread raw  udp function ? )

P.S. Thread C using tcp socket with select function, but it working ok.

 

 

 

 
 
 
 
 
 


_______________________________________________
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]