Hello all,
Craig Graham wrote:
On Tuesday 11 April 2006 09:28, Kieran Mansley wrote:
On Tue, 2006-04-11 at 09:53 +0200, Julika Burger wrote:
Hi,
I have a question about lwip.
Is lwip really multi threading able?
Is it possible to open two sockets at the same time and read and write
data to them?
We use the PSOS Operating system and I can not control if two threads at
the same
time use a socket or not.
No. To be honest, the sockets API doesn't really allow you to do that
in any meaningful way on other operating systems either. You need to
add a mutex to protect access to the socket and use that so that only
one thread is using it at any one time.
Kieran
I think what Julika was trying to ask was can two threads open two separate
sockets and both threads use their own sockets (rather than can two threads
access the same socket). And the answer to that question is, of course, yes.
The answer depends:
If using the raw API, "no", and "yes" only if *you* provide mutual
exclusive access to lwIP. This is the way we do
it under uCOS-II, a hard real-time OS. Note that all core calls are O(1)
without any waiting loops.
If using the sysarch layer, "yes" provided you made a good match between
underlying OS and sysarch layer and
so lwIP can use the right synchronization methods in the right way.
Regards,
Leon.
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users