[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] simultaneous send and recv
From: |
Kieran Mansley |
Subject: |
Re: [lwip-users] simultaneous send and recv |
Date: |
Tue, 02 Oct 2007 08:46:50 +0100 |
On Mon, 2007-10-01 at 17:38 -0500, address@hidden wrote:
> I've also been wondering if there is something with lwip not being
> entirely thread safe, as I'm accepting the connection in one thread, and
> writing to it in another?
Yes, lwIP is not thread safe. It's OK to pass a connection from one
thread to another when you accept it as you are doing, but you have to
make sure that only one thread is trying to use the core of lwIP at one
time. This includes ensuring that your receive packet processing (e.g.
maybe driven from an interrupt or polled by another thread?), the TCP
timers (maybe another thread?), and your own application threads are all
mutually exclusive.
There have been a lot of improvements in this area recently which should
at least make it clearer what is allowed and what is not, and we hope to
release 1.3.0 soon. Sadly I've not had enough time to devote to get a
release candidate out recently, but I hope that it won't be too much
longer.
Kieran