[En-Nut-Discussion] NutTcpConnect and NutTcpCloseSocket problem

Bernd Walter enut at cicely.de
Mon Aug 13 23:47:08 CEST 2012


On Fri, Aug 10, 2012 at 02:04:46PM +0200, Ole Reinhardt wrote:
> Hi Oliver
> 
> > Yes, the board reseted !
> > 
> > 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...
> 
> No, not necessarily. There _might_ be a bug. But however the solution
> would not be to introduce a sleep there but to find the possible race
> condition (if there is any at all).
> 
> I think we will have to check this further before changing anything
> hasty. For now it's just an idea. I will do some tests with the
> debugger. But I only can do so on my LCP or ARM boards, as I don't have
> an ethernut 2.1 at hand.
> 
> 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.
Of course tcpsm needs to have higher priority as higher priority
always gets the CPU over lower priority threads.
High priorities are there for low level services.

-- 
B.Walter <bernd at bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.


More information about the En-Nut-Discussion mailing list