lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] Re: Semaphores and tcpip_input


From: Samuel Thibault
Subject: [lwip-devel] Re: Semaphores and tcpip_input
Date: Wed, 7 Nov 2007 10:52:45 +0000
User-agent: Mutt/1.5.12-2006-07-14

Hi,

Simon Goldschmidt wrote:
> > src/api/sockets.c uses a semaphore (selectsem) for protecting
> > critical sections of select().  The result is that event_callback()
> > may want to sleep, which is a problem if one wants to call event_callback()
> > from an interrupt handler for instance.
> 
> Calling event_callback from an interrupt handler is not supported!
> ...
> ip_input() would perhaps enter tcp_input() which shares states with
> tcp_output(),
> 
> The solution to this problem is calling tcpip_input() instead of
> ip_input() from your interrupt handler.

The problem with this is that tcpip_input() uses sys_mbox_post(), and
in our implementation the mbox has a fixed maximum size, which could
hence overflow.  In a thread context we just use a semaphore to make the
thread sleep, but in an interrupt context we should probably just drop
the packet, but the interface doesn't permit this...

Samuel




reply via email to

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