the tcpip_init function starts up all the required timers (which happens in
tcpip_thread startup).  You should not be starting them 'manually'.  The
timeout handlers usually have a call to sys_timeout that set's itself as the
timeout handler, which essentially sets up a periodic timer.

On Jan 14, 2008 12:18 AM, Muhamad Ikhwan Ismail <[EMAIL PROTECTED]>
wrote:

> Hi,
>
> I got some qs on timer functions on lwip, read some thread on it
> previously but it doesnt really answer my qs.
> I ll try to generalize this so that any future user can use this thread
> for the same problem.
> Im using lwip 1.2 porting it on a SMX OS on PowerPC MPC852T. Just wanna
> make sure I am right before i run some multithreading test.
>
> 1. The are 2 timers for the whole stack, which are the arptimer and the
> tcp timer am I right ?
>
> 2. The arptimer is initialized in ethernetif_init  through this piece of
> code :
> sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL);
> which then will be assign a struct timeout to the tcpip thread's timeout
> (since I call it from the tcpip thread initialization) linked list and will
> be checked and updated each time I wait on semaphore or fetch a message.
> Hence I dont have to call the arptimer().
> Am I correct so far ?
>
> 3. My biggest problem is the tcp_timer. It is called by the
> tcpip_tcp_timer by tcpip API. But no other function calls the
> tcpip_tcp_timer
> hence I guess I need to call it myself ? If I do have to call it myself, I
> guess there are 2 ways. One is I call it before I wait for semaphore after
> tcpip_thread finishes the job
> it got with the message it fetched. Or call another thread to call
> tcpip_tcp_timer which is literally bad cause the stack itself is not
> multithreading safe, isnt it?
>  If  anyone has done something like this and has tips where I can use the
> timer safely, I'd appreciate any tips.
>
> 4.I am writing a telnet server program which have 2 task, both using the
> same socket for transmit and receive. This is possible if i do a critical
> section protection each time
> the socket does receive or send, preventing simultaneous access on the
> socket, am I right ?
>
> I am thankful for any answers you could provide me.
>
> Greetings,
> Ikhwan
>
>
>
>
> ------------------------------
> Share life as it happens with the new Windows Live. Start 
> sharing!<http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008>
>
> _______________________________________________
> lwip-users mailing list
> [email protected]
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>



-- 
Thomas Taranowski
Expert embedded software design/contracting
[EMAIL PROTECTED] (remove the n0sp4m)
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to