lwip-users
[Top][All Lists]
Advanced

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

Re:Re: [lwip-users] Timers Question


From: yangjinwei82
Subject: Re:Re: [lwip-users] Timers Question
Date: Fri, 10 Apr 2009 16:07:51 +0800 (CST)

Dear Simon,
I find function "main_thread" from contrib1.3.0(contrib/ports/unix/proj/unixsim/simhost.c),which were downloaded from http://ftp.twaren.net/Unix/NonGNU/lwip/.Referring to the contrib is a good way for our porting.

Younger


在2009-04-10,"address@hidden" <address@hidden> 写道:
>@Younger: There is no function like 'main_thread' in the lwip source!
>
>What you have to do is
>a) provide a timeouts structure per thread, sys_arch_timeouts() must 
>return a unique structure for the currently running thread
>b) provide the correct wait-time return values for sys_arch_sem_wait() 
>and sys_arch_mbox_fetch()
>
>sys_sem_wait() and sys_mbox_fetch() will call the timeout handlers when 
>enough time has passed waiting for semaphores/mboxes. The protocol 
>timers are initialized in tcpip_init(), from v1.3.0 on you just have to 
>call lwip_init().
>
>The downside of this timer-approach is that timers are not really 
>accurate when processor load is high in the tcpip_thread (active time 
>vs. wait time) or if you never really wait much at all on sems/mboxes. 
>There is a task on savannah for this to be implemented better (also for 
>NO_SYS=1 which currently can't use the timeouts) but for now, this is 
>how you have to do it.
>
>Simon
>
>
>John Kennedy wrote:
>> Hi,
>> I'm porting lwip using an RTOS and sockets, but I'm not certain what I have to do about timers.
>> Using an RTOS do I need to periodically call any timer functions within lwip like etharp_tmr, tcp_tmr, dns_tmr, dhcp_coarse_tmr, dhcp_fine_tmr, ip_reass_tmr, igmp_tmr, autoip_tmr?
>>
>> Thanks,
>> John
>
>
>
>_______________________________________________
>lwip-users mailing list
>address@hidden
>http://lists.nongnu.org/mailman/listinfo/lwip-users



网易邮箱,中国第一大电子邮件服务商

reply via email to

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