lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] sys_timeout handler will not be called


From: kuwa
Subject: Re: [lwip-users] sys_timeout handler will not be called
Date: Mon, 09 Feb 2004 17:15:59 +0900 (JST)

Hi,

Sorry for my recent multi posts.

From: "John Taylor" <address@hidden>
Subject: RE: [lwip-users] sys_timeout handler will not be called
Date: Fri, 6 Feb 2004 13:06:53 -0500

> >On Behalf Of Jani Monoses
> >
> >I did some tests on ecos today and until I made sys_timeout use
> >statically allocated timeouts (so not calling memp) it crashed when
> >using lots of timers which fired very quickly.
> Question - why does calling memp frequently crash the system?  Is the
> buffer pool being exhausted and the code is not properly handling the
> out-of-buffer condition?  Or is there bug in the memp code itself that
> does not show up until the memp code is put under stress as in the your
> test above?
> 
> >I propose changing sys_timeout to work with timeout structures
> >preallocated by the user both for performance and correctness.

Thank you and look forward to your work.

> I agree completely with this change - but more for performance aspects
> of the change.

Regarding timers, I have not encountered system crash but only timer
stopping.

Current lwIP timer implementation helps me because I need not much to
concern about task/thread safety.  Because, as you know, timeout
handler is only called from inside the task which registered the
handler by using sys_timeout and it is only invoked when the task
calls sys_sem_wait() and so on.

But I also feel some kind of difficulty to use lwIP timer because I
need to understand I need to call sys_sem_wait() stuff to activate
timers in the same task.  And because when I activate multiple timers,
IMHO it affects system performance.

Attached is result of ping to my lwIP hosts.
When I register ARP timer(10sec), DHCP fine timer (500msec) and DHCP
coarse timer (60sec), response time is swinging.
On the other hand, when I don't register timeout handlers, it is
almost smooth 16 or 17ms.
Please note that base speed is very slow because CPU(8051 family) is
slow and I still have been under porting.  I will test different CPU
with same lwIP(STABLE-0_7_1) and same OS (uC/OS-II 2.70).

I guess it may be a hard trade-off among ease of use timer, multi
threaded safety and performance...


address@hidden ~
$ ping 10.21.7.37 -t

Pinging 10.21.7.37 with 32 bytes of data:

Reply from 10.21.7.37: bytes=32 time=16ms TTL=128
Reply from 10.21.7.37: bytes=32 time=50ms TTL=128
Reply from 10.21.7.37: bytes=32 time=115ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=60ms TTL=128
Reply from 10.21.7.37: bytes=32 time=117ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=50ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=49ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=49ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=49ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=49ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=49ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=16ms TTL=128
Reply from 10.21.7.37: bytes=32 time=48ms TTL=128
Reply from 10.21.7.37: bytes=32 time=16ms TTL=128
Reply from 10.21.7.37: bytes=32 time=16ms TTL=128
Reply from 10.21.7.37: bytes=32 time=56ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=44ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128
Reply from 10.21.7.37: bytes=32 time=51ms TTL=128
Reply from 10.21.7.37: bytes=32 time=17ms TTL=128

Ping statistics for 10.21.7.37:
    Packets: Sent = 37, Received = 37, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 16ms, Maximum = 117ms, Average = 33ms
Control-C


address@hidden ~
$

--
Shuji KUWAHARA




reply via email to

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