>Kieran Mansley <address@hidden> wrote
2007-06-01 11:52:39 :
>
> On Fri, 2007-06-01 at 11:41 +0200, address@hidden
> wrote:
> >
> > Does LwIP make any asumption on the order that semaphores are
> > released.
> > I.e. if two threads use LwIP does the LwIP TCP/IP-thread assume
that
> > the messages
> > sent over a common message box will be received by the threads
in the
> > order that they are sent?
> > Or is it ok to have a "polling" semaphore system where
threads waiting
> > on the same semaphore might
> > be woken regardless to how long they have been waiting.
>
> Can you provide some more details? This sounds rather like you're
using
> the same connection from two different threads without using a mutex
to
> protect it. Frederic is the expert on this, and has ideas about
how to
> resolve it, but it's known not to work at the moment. It's probably
> best to assume that lwIP, for reasons of simplicity, doesn't currently
> support multiple threads using the same connection at the same time.
>
> Kieran
>
Yes, we have a number of threads (actually two threads)
using the same socket to send data on one thread, and receive using the
other thread. The socket in question has been marked with the NONBLOCK flag (using
ioctlsocket(sock, FIONBIO, &dontBlock)).
At the same time were using a "polling"
semaphore system... And the problem right now
is that after some heave traffic the
sending thread seem to get stuck in a call to lwip_send().