lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] LwIP 1.3.1 - Using tcp_write() outside of 'raw api' cal


From: Simon Goldschmidt
Subject: Re: [lwip-users] LwIP 1.3.1 - Using tcp_write() outside of 'raw api' callback context?
Date: Fri, 18 Nov 2011 17:22:21 +0100

"Brian McFarland" <address@hidden> wrote: 

Is it safe to use tcp_write(), tcp_output(), etc from task #2 in this scenario?

No.

Do I need to put the tcp_write() call in a critical section that blocks the network task from running?

Thats one possibility, but blocking the network task is not enough: you also would have to ensure that you haven't interrupted it while it's inside the lwIP code somewhere.

Or would it be safer/better to have queues going both ways to where the network task main loop checks for pending calls to tcp_write()?

And that's the 2nd possibility, which is implemented by our API layer, BTW (e.g. by calling tcpip_callback).

Both possibilities work fine, it's up to you which one you like best.

Simon

reply via email to

[Prev in Thread] Current Thread [Next in Thread]