[En-Nut-Discussion] NutTcpConnect and NutTcpCloseSocket problem

Harald Kipp harald.kipp at egnite.de
Tue Aug 14 11:49:38 CEST 2012


On 13.08.2012 23:47, Bernd Walter wrote:
> On Fri, Aug 10, 2012 at 02:04:46PM +0200, Ole Reinhardt wrote:
>>> I understand what you said in your explanation.
>>> This means that NutTcpSocketClose should use somewhere NutSleep(1) instead of NutThreadYeald().
>>> As NutSleep(1) can releases the CPU to a lower priority thread...
...
>> Perhaps Harald could also do some tests?
> 
> I don't think that a thread running at higher priority than tcpsm
> should use sockets at all.

That's my view as well. IMHO, it makes no sense at all to run a TCP application thread at a higher priority than the TCP state machine. If part of that application needs a high priority, then this part should get it's own thread.

Be aware of the cooperative nature of Nut/OS threads. If you need realtime behaviour, you have to use interrupts in most cases.

Regards,

Harald





More information about the En-Nut-Discussion mailing list