lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] lwIP RAW API and "deferred processing" in different con


From: Simon Goldschmidt
Subject: Re: [lwip-users] lwIP RAW API and "deferred processing" in different context
Date: Wed, 07 Dec 2011 08:04:14 +0100

Ueli Niederer <address@hidden> wrote:
>    - Am I missing something if I wrap every tcp_*-call and the  
> relevant portions of a callback in SYS_ARCH_PROTECT/SYS_ARCH_UNPROTECT  
> calls if I want to cross a context border?

In your scenario below (where the input and timer processing is effectively 
locked, already, since it runs in the ISR context that you protect from, I 
assume), it should suffice to lock interrupts for all calls into the stack 
(i.e. tcp_write, etc.). This assumes that the stellaris netif driver can handle 
this correctly.

>    - Is it correct, that pbuf_*-calls and memp_*-calls are already  
> constructed thread-safe?

Partly. Allocation/deallocation and pbuf_ref() are safe as long as 
SYS_ARCH_PROTECT is implemented correctly and enabled, they should be safe to 
use from ISR vs. application level. Other functions like pbuf_header() are not 
safe, but in your scenario, that should be OK.

In general, it would be a better idea to enqueue RX packets for processing at 
application level, though, so that lwIP runs completely at application level.

Simon
-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!               
Jetzt informieren: http://www.gmx.net/de/go/freephone



reply via email to

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