« Return to Thread: UDP socket thread safe problem

UDP socket thread safe problem

by Darius Babrauskas :: Rate this Message:

| View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.
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.
http://lists.gnu.org/archive/html/lwip-users/2009-01/msg00011.html   but no any answer.
 
 
http://savannah.nongnu.org/bugs/?func=detailitem&item_id=20288

"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
lwip-users@...
https://lists.nongnu.org/mailman/listinfo/lwip-users

 « Return to Thread: UDP socket thread safe problem