Replying to list as others may find this useful. Please do the same. On Tue, 2008-05-20 at 19:49 +0800, xcbman wrote: > The same socket in different threads, Are all socket function(connect > ()\recv()\send()\close()) must be protected against concurrent > access?? Or just connect() and close() function need to protected > against concurrent access? Is Lwip later version can resolve different > thread use the same socket?
Probably safest to assume that all socket operations must not be used concurrently on the same socket from different threads. > Is there any way instead socket layer function to resolve concurrent > access? thank you for help. You could have a lock, and use that to protect against concurrent access. Or you could write your program so that you know it won't happen this way. For example, it's common to have a thread that does the listen and accept of new connections. This will then hand the connection over to another thread to do the data transfer. The socket is used from two threads, but not at the same time, and so there's no problem. Kieran _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
