[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #1902] Timeouts and semaphores/mailboxes are too tight
From: |
Simon Goldschmidt |
Subject: |
[lwip-devel] [bug #1902] Timeouts and semaphores/mailboxes are too tightly integrated |
Date: |
Fri, 20 Apr 2007 21:27:10 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3 |
Follow-up Comment #15, bug #1902 (project lwip):
Finally... I've put together a first patch introducing new timers using
timestamps. This solves only semaphore/timer integration, as timer-callbacks
are still called inside sys_mbox_fetch() which is a good implementation, I
think (as it saves us from locking as opposed to calling timeout handlers
from interrupt context). In places where this is not wanted,
sys_arch_mbox_fetch(mbox, msg, 0) can directly be called.
OK, now to the patch: it introduces 2 new types (timestamp_t (normally u32_t)
and timediff_t (normally s32_t)) which have to be defined in cc.h, uses the
function sys_jiffies() (already defined in sys.h but no needed in many ports)
and converts jiffies to ms by using a define SYS_ARCH_TICKS_PER_SECOND (to be
defined in sys_arch.h). Then, expiration times are stored absolutely in
timers.
NOTE: to avoid confusion with timeouts given as an argument to functions like
sys_sem_wait_timeout(), I called the lwip timeous 'timers' since I think
timeouts is a bad name . Further, I renamed sys_timeout to sys_timer_create
and sys_untimeout to sys_timer_remove (and did not include files depending on
the new names in the patch!). This must not necessarily be part of CVS, of
course. We should discuss that!
Last, I have to say I'm not really content with the patch as it is, as there
is much calculation from jiffies to ms which, besides performance loss
includes some wrap-arounds corner cases... I'd prefer to handle all timers in
jiffies and convert ms-timeouts given as function-arguments into jiffies. That
way, simple addition/substraction is enough. Especially seen that most ports
must convert ms to jiffies in sys_arch.c ... But that can be changed later,
also.
OK, so here's the patch:
(file #12539)
_______________________________________________________
Additional Item Attachment:
File name: newtimers1.patch Size:18 KB
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?1902>
_______________________________________________
Nachricht geschickt von/durch Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #1902] Timeouts and semaphores/mailboxes are too tightly integrated, Jonathan Larmour, 2007/04/10
- [lwip-devel] [bug #1902] Timeouts and semaphores/mailboxes are too tightly integrated, Simon Goldschmidt, 2007/04/11
- [lwip-devel] [bug #1902] Timeouts and semaphores/mailboxes are too tightly integrated, Kieran Mansley, 2007/04/11
- [lwip-devel] [bug #1902] Timeouts and semaphores/mailboxes are too tightly integrated, Jonathan Larmour, 2007/04/11
- [lwip-devel] [bug #1902] Timeouts and semaphores/mailboxes are too tightly integrated,
Simon Goldschmidt <=
- [lwip-devel] [bug #1902] Timeouts and semaphores/mailboxes are too tightly integrated, Jonathan Larmour, 2007/04/20
- [lwip-devel] [bug #1902] Timeouts and semaphores/mailboxes are too tightly integrated, Kieran Mansley, 2007/04/23
- [lwip-devel] [bug #1902] Timeouts and semaphores/mailboxes are too tightly integrated, Simon Goldschmidt, 2007/04/26
- [lwip-devel] [bug #1902] Timeouts and semaphores/mailboxes are too tightly integrated, Jonathan Larmour, 2007/04/26
- [lwip-devel] [bug #1902] Timeouts and semaphores/mailboxes are too tightly integrated, Simon Goldschmidt, 2007/04/27