<div dir="auto"><div dir="auto">Hi Sebastian</div><div dir="auto"><br></div>I used rtems_task_wake_after().<div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 4 Apr 2019, 18:22 Sebastian Huber, <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">How do you wait. Is this a busy wait?<br>
<br>
----- Matthew J Fletcher <<a href="mailto:amimjf@gmail.com" target="_blank" rel="noreferrer">amimjf@gmail.com</a>> schrieb:<br>
> replying to myself.<br>
> <br>
> With a 1 second pause between socket() and close() and 512 sockets it will<br>
> still ENOBUFS,.. without calculating it properly thats easily 10 minutes<br>
> since the first socket was allocated,. that must be enough time to start<br>
> freeing the socket buffers internally.<br>
> <br>
> <br>
> On Thu, 4 Apr 2019 at 16:47, Matthew J Fletcher <<a href="mailto:amimjf@gmail.com" target="_blank" rel="noreferrer">amimjf@gmail.com</a>> wrote:<br>
> <br>
> > Hi,<br>
> ><br>
> > I have noticed an issue with lib-bsd that the legacy stack does not have.<br>
> ><br>
> > If have a loop that does<br>
> ><br>
> > for (;;)<br>
> > {<br>
> > wait(100) // milliseconds<br>
> > socket() // allocate<br>
> > close() // free<br>
> > }<br>
> ><br>
> > then i can see the socket numbers allocated upwards, but eventually the<br>
> > get ENOBUFS from socket(),.. allocating more sockets just delays the<br>
> > problem occurring.<br>
> ><br>
> > It seems like this is some lazy freeing or complex system designed for<br>
> > high loading systems to make close() faster, but on an embedded system its<br>
> > malfunctioning.<br>
> ><br>
> > is there some lib-bsd function that can force a 'flush' to prevent this ?<br>
> ><br>
> > --<br>
> ><br>
> > regards<br>
> > ---<br>
> > Matthew J Fletcher<br>
> ><br>
> ><br>
> <br>
> -- <br>
> <br>
> regards<br>
> ---<br>
> Matthew J Fletcher<br>
<br>
-- <br>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone : +49 89 189 47 41-16<br>
Fax : +49 89 189 47 41-09<br>
E-Mail : <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank" rel="noreferrer">sebastian.huber@embedded-brains.de</a><br>
PGP : Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. <br>
</blockquote></div>