lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #21433] Calling mem_free/pbuf_free from interrupt cont


From: EVS Hardware Dpt
Subject: [lwip-devel] [bug #21433] Calling mem_free/pbuf_free from interrupt context isn't safe
Date: Mon, 29 Oct 2007 10:30:46 +0100

Hello,

>SYS_ARCH_LOCK_RESOURCE

It's a idea which can be merged with "task #7212 : Add Mutex concept in
sys_arch"


Yes and No, a mutex should block until it's free again. We do not have an OS, and so no primitive to block on something. You may think "OK, no OS, no thread, no need to block", but it's the very problem we have. How to lock access to a resource without the need to disable Interrupts and without OS primitives to wait until resource is free.

The proposed architecture could solve the problem although limited to mem.c module. You don't execute some parts of code because they are locked (in our example, we are currently at ISR level trying to free memory allocated by a PBUF, ISR interrupted the program while allocating some memory. All was protected by semaphores, but implemented as nothing because NO_SYS=1) but remember they weren't executed. Then, when possible execute them.

Fred.


reply via email to

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