lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Reentrancy in LWIP


From: Timmy Brolin
Subject: Re: [lwip-users] Reentrancy in LWIP
Date: Tue, 28 Sep 2010 22:11:45 +0200
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

Today the device drivers and application threads exchange information
with the lwip thread using mailboxes. This avoids any reentrancy issues.

There is a task registered on savannah, where it has been suggested that
a simple global semaphore lock for the entire lwip stack probably would
be better (higher performance due to less rescheduling, and smaller ROM
footprint).
There is some experimental code in place for this lock, but nothing stable.

Timmy Brolin


Kieran Mansley wrote:
> On Tue, 2010-09-28 at 19:04 +0530, Chandran, Smitha wrote:
>   
>> I have been going through the lwip source code and I have seen instances of 
>> methods which update data into variables and return them...
>> My intention is to interface lwip to both an ethernet device as well as a 
>> usb-wifi device...
>> So was wondering if such non-rentrant code could lead to issues.
>>     
>
> Yes, it would, but you shouldn't write your code that way: lwIP core
> should only be accessed by a single thread.  The normal method to
> achieve this is to have all lwIP processing done by a single thread and
> the device drivers (e.g. for Ethernet or USB) pass packets to this
> thread for processing.  This isn't an just an issue where you have more
> than one device driver either, it applies to protecting lwIP from
> concurrent access by application threads and device driver context too.
>
> Kieran 
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
>   



reply via email to

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