lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] Protection of pbuf during ISR


From: Kieran Mansley
Subject: [lwip-users] Re: [lwip] Protection of pbuf during ISR
Date: Wed, 08 Jan 2003 23:56:10 -0000

The standard solution to this would be to use a bottom half.  I guess this
is similar to (2) in your list.  In general, doing lots of things in ISR
is a bad idea, which is why you are generally unable to block, and this
prevents you doing things like allocating memory etc (in more complex OS).
In the case of an embedded system though, the fact that you are spending a
lot of time in ISR might not be much of a problem though as there will be
very few other processes running that you might be disadvantaging.  You do
mention that printing is a higher priority than network processing though,
so if that really is the case you want to do as little as possible at
interrupt time.

Another possiblity for your list of solutions would be to use an event
queue.  This isn't too complex a concept, but basically allows your NIC to
queue events (hence the name!) for an application to deal with at a later
date.  This avoids the need for interrupts unless the event queue becomes
empty as the application just continues to poll the queue while it has
something in.  As this reduces the interrupt overhead it can be much more
efficient.  It does require a small amount of sophistication in your
network interface though to do properly.

I agree that (1) would not be too popular in general, but there's nothing
to stop you doing it in your own code - many of us have made changes to
lwIP to make it work for our specialist circumstances and just kept these
in our own versions.

Hope that helps,

Kieran

[This message was sent through the lwip discussion list.]




reply via email to

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