Calling socket interface - which thread to use?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Calling socket interface - which thread to use?

Wilson, Clive
Calling socket interface - which thread to use?

Hello,

I have a multi-threaded LwIP app that uses the socket interface (write(), read() etc). I'm using the PPP network interface, so I have ppp thread, tcpip thread, and my app thread. I'm not 100% sure whether it is important for the socket api to be called from any particular thread, or if there is a thread interface that takes care of that. My hunch is that I can make the socket calls from within the app thread and the api looks after passing the data to the tcpip thread.

Does anyone have a view on this?

Many thanks in anticipation,

CTW


_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Calling socket interface - which thread to use?

Kieran Mansley
On Tue, 2006-08-01 at 12:55 +0100, Wilson, Clive wrote:

> Hello,
>
> I have a multi-threaded LwIP app that uses the socket interface (write
> (), read() etc). I'm using the PPP network interface, so I have ppp
> thread, tcpip thread, and my app thread. I'm not 100% sure whether it
> is important for the socket api to be called from any particular
> thread, or if there is a thread interface that takes care of that. My
> hunch is that I can make the socket calls from within the app thread
> and the api looks after passing the data to the tcpip thread.
>
> Does anyone have a view on this?

I think that is correct.  If you had more than one application thread,
you would need to serialise access to your sockets so that you didn't
have more than one thread using the stack at the same time.

Kieran



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users