lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] Sys_timeouts


From: Goldschmidt Simon
Subject: RE: [lwip-users] Sys_timeouts
Date: Thu, 24 May 2007 08:47:39 +0200

> Hello all, thank you for answers to my queries. I still don't 
> get the complete idea of sys_timeouts. The documentation says 
> it's a linked list of structures per thread that is used by 
> lwip timeout scheduler. Where and with what should I populate 
> this linked list. 

If you use lwIP's socket API you don't have to (in fact, you
mustn't) populate the list! The lwip core thread (tcpip_thread)
uses sys_timeout() to populate the list and eventually, it will
get emptied while waiting for a message from an mbox (in the
tcpip_thread() loop).

> 
>      One more thing I don't understand is why is 
> sys_arch_mbox_fetch there but not sys_arch_mbox_post ?. 

The names are a little confusing: sys_arch_mbox_fetch is the
correspnding function to sys_mbox_post. But since sys_mbox_fetch
processes the timeout list (and calls sys_arch_mbox_fetch),
you can also directly call sys_arch_mbox_fetch if you don't want
to use timeouts.

> 
> I am  running on a bare platform and I have my own working OS 
> services ( scheduler, semaphores, message queues) and I feel 
> that I should have my own sys.c, ie my own API layer so that 
> I need not worry about timeouts. Is sys.c the api layer you 

3 cases:
- you only want raw (callback) API which is very fast, then
you don't need an API layer
- you can use the api layer provided with lwip (e.g. the files
under api/*) then you need to implement the sys_arch.c file
(see msvc6 port for a reference)
- the api provided with lwip is not 'good enough' for you, then
you have to implement your own api. You don't have to touch sys.c
for that!

> were talking about when you said "if you have your own API 
> layer, you can ignore timeouts". ?

I think no, but I can't talk for Mumtaz.

Simon




reply via email to

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