lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Advanced lwip raw API questions


From: Bill Auerbach
Subject: Re: [lwip-users] Advanced lwip raw API questions
Date: Mon, 18 Nov 2013 14:49:30 -0500

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf
Of ella
Sent: Monday, November 18, 2013 2:14 PM
To: address@hidden
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





reply via email to

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