lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] core/timers.c with NO_SYS?


From: Leon Woestenberg
Subject: Re: [lwip-devel] core/timers.c with NO_SYS?
Date: Tue, 14 Jun 2011 17:13:39 +0200

Hello,

On Tue, Jun 14, 2011 at 10:53 AM, Simon Goldschmidt <address@hidden> wrote:
>
> Leon Woestenberg <address@hidden> wrote:
>> I am not following the criticism. Who talked about interrupt locks? I
>> certainly did not.
>
> I was talking about interrupt locks since its currently a common 
> implementation to protect the memp and pbuf code.
>
>> Why would pbuf, mem and memp be interrupt disabled locks? That makes
>> no sense to me. They are not in any way related to an interrupt
>> (handler).
>
> Of course they are: RX interrupts from the MAC may call pbuf_alloc(PBUF_POOL) 
> to allocate a pbuf to copy received data to.
>
That's why in an RTOS environment the interrupt handler must not do
the actual work; it must schedule a thread that takes the appropriate
lock, not an interrupt disable lock.

Doing work in an interrupt handler is a common design mistake; the
interrupt handler should only make sure the interrupt is silenced
until serviced by a thread.

But it seems there are too many different approaches to take, and
people are using the current architecture for that. I think there is
no way to clean up the current mess without breaking these existing
users.

I will start a new effort on a proper RTOS layer on top of the raw API.

Regards,
-- 
Leon



reply via email to

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