-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of ella Sent: Monday, November 18, 2013 2:14 PM To: [email protected] Subject: Re: [lwip-users] Advanced lwip raw API questions
Hi, Thanks for your reply. The most disturbing thing for me is your NO to my question about tcp_* thread safe. In other words it means that all processing should be done in tcp callback ONLY as this is the only code running in tcp thread context !? Right now I did something like this: /* Receive Callback (tcp thread)*/ ... xQueueSend( queue_srv, &my_data, 0 ); /* Server Thread (My server thread) */ xQueueReceive( queue_srv, &my_data ... ); /* Processing */ ... tcp_write( ... ); tcp_output( .... ); If tcp_write and tcp_output are not thread safe I do not know how to implement server that requires long processing. ---------------------------------------- Hi, You're welcome. There's a good bit documented about lwIP and threading (or not using multiple threads). This is a good start: http://lwip.wikia.com/wiki/LwIP_with_or_without_an_operating_system I use a cooperative multi-tasking kernel so don't worry about the threading issue because I can't interrupt the TCP/IP thread, but I am able to send TCP messages from all running threads. In fact, one thread is a telnet thread and when telnet is connected, all program debug printfs send to the telnet connection (or are ignored otherwise). I was not up for making things thread safe or worrying about internal TCP thread messaging issues. My systems are realtime and I don't have the overhead or preemption issues to worry about. Bill _______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users
