|
From: | Nicolas Pinault |
Subject: | Re: [lwip-users] Socket read/write and threads |
Date: | Tue, 12 Jan 2010 09:31:48 +0100 |
User-agent: | Thunderbird 2.0.0.23 (Windows/20090812) |
Yoav Nissim a écrit : As with a single thread my application still does not work correctly, I suspect there is a bug in my port.Pardon me for barging in... I have encountered the same issue about a week or two ago. Using select() would be the natural choice for performing multiple non-blocking operations. You can either: 1. Use select() in a single thread to perform both Rx & Tx (recommended) 2. Keep Rx and Tx threads locked and waiting on a select running in another thread (in essence adding the locking mechanism that lwIP does not support) I'd like to check some points : I use a thread for MAC rx. This thread waits for MAC rx frames and calls ethernetif_input(). This thread has a lower priority than TCPIP_THREAD_PRIO. Is this ok ? My current port implementation is simple and when transmitting, low_level_output() waits for the packet to be sent before returning (wait on a semaphore set by Tx interrupt). Is this ok ? There is no mutex between tx and rx functions. That is, ethernetif_input() can be entered while low_level_output() is running and vice-versa. Is this a problem ? What must be the application thread priorities ? Higher priority than TCPIP_THREAD_PRIO ? Lower priority than TCPIP_THREAD_PRIO ? Regards, Nicolas HTH, Yoav. On 11/01/10 9:46 AM, Nicolas Pinault wrote:address@hidden a écrit :Nicolas Pinault wrote:Is this a threading problem ?Yep, using a socket from more than one thread at the same time is currently not supported.Ok. So, what do you recommend to asynchronously send and receive data (with a socket). NicolasSimon _______________________________________________ lwip-users mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/lwip-users_______________________________________________ lwip-users mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/lwip-users |
[Prev in Thread] | Current Thread | [Next in Thread] |