lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #1902] Timeouts and semaphores/mailboxes are too tight


From: Atte Kojo
Subject: [lwip-devel] [bug #1902] Timeouts and semaphores/mailboxes are too tightly integrated
Date: Fri, 09 Mar 2007 09:55:01 +0000
User-agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.5 (like Gecko)

Follow-up Comment #4, bug #1902 (project lwip):

I agree with Frédéric on removing sys_timeout stuff entirely from user-side
functions. Simply calling sys_arch_mbox_fetch and sys_sem_wait suffices for
user-side timeouts.

In my opinion the stack's internal timeouts could be handled in one of two
ways:

1. Make all sys_* functions just thin wrappers around native OS functions and
use a special timeout handling wrapper in tcpip_thread á la current
sys_mbox_fetch implementation (with timestamping as discussed in bug #19222)
around sys_arch_mbox_fetch.

2. Create a timeout hook function that is called from OS's tick handler. The
hook function sends a timeout message to tcpip_thread which then calls the
appropriate timeout handler. This could be similar to how API calls are
currently handled. (I guess that this is what Christiaan was talking about
with his SIGALRM stuff).

Both implementations would make timer handling thread-safe because the timers
are only called from core stack contenxt. Another plus is that the stack is
always in well defined state when calling timeout handlers. Especially when
combined with the solution to bug #19206.

Solution 2 would provide pretty accurate timers but since it require
re-designing/writing how lwIP handles timeouts, I'd go for solution 1 now. It
should provide good enough accuracy for most purposes. I also think that this
is what Simon and Frédéric have in mind.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?1902>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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