Just to clarify this: lwIP's core is (intentionally) not thread-safe: It
should be small to be used without an OS. If you want to use it from
different threads, you cannot use the raw api, use the netconn or
sockets api instead (if anyone doesn't know what that is, read about it
at http://lwip.scribblewiki.com/). Thus lwIP _is_ thread safe if you
want it to.
That said, if I understand you correctly, you want to run 200 full
instances of lwIP in one process: that doesn't work (also,
intentionally): many parts in lwIP use global or static variables (the
whole stack is _not_ reentrant). After all, running lwIP in a process is
much like running it on its own device (a completely seperate address
space). Running 2 instances in 2 different threads in the same process
is like running it twice on the same device: you could make it work with
a high effort, but there's no use for that in normal life...
Simon
Bob McConnell wrote:
Looking through the list archives, I get the impression that lwIP is not
fully thread safe. How much work will be involved to correct this
problem, and is anyone working on it now?
Why? I have a project to prototype a test bench at work that requires
multiple instances of a TCP/IP stack connecting to TUN/TAP devices on
FreeBSD or Linux to emulate a network of embedded devices. The host OS
will act as a firewall/router and each instance of the stack will have a
unique IP address. The goal is to emulate a couple thousand devices. I
would like to build a prototype that creates 200 instances using
pthreads. I can probably do it with 200 processes, but that will be much
more difficult to control and manage. The network traffic will also be
channeled through Dummynet for reliability and performance testing.
I have some related questions about keep-alive configurations, but will
send them separately.
Thank you,
Bob McConnell
N2SPP
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users