timeout.c in bsd_tcpip

Andrew Lunn andrew.lunn@ascom.ch
Fri May 9 09:25:00 GMT 2003


> I don't agree. I think that the old untimeout() is not only inefficient
> but also wrong. 
> First, the link list headed by timeout may link many tcp timers
> such as tt_rexmt, tt_persist, tt_keep, tt_2msl and tt_delack.
> These timers are linked on the list by calling callout_reset() directly, 
> not calling timeout() since they don't need to allocate the entry space 
> for it. Actually the spaces for these timers are allocated 
> (or point to the allocated space) in tcp_newtcpcb(). Likewise these 
> timers are removed from the link list by calling callout_stop()
> directly. On the other hand, untimeout() is used to remove the timer entry 
> which was allocated by timeout() previously. 
> Second, the old untimeout() change the link by calling callout_stop() 
> at the same time when it is tracing the link itself.
> So I think that to look at all elements in the array(_timeout) is 
> not only efficient but also right.

I assumed (wrongly) that all entries we allocated by timeout. I didn't
relies most where in fact using there own memory. In that case, i
agree with you. Looking at each elemet in the array is the correct
thing to do.

      Andrew



More information about the Ecos-patches mailing list