[Tinyos-devel] ENOMEM in TinyError.h

Philip Levis pal at cs.stanford.edu
Tue May 6 09:21:20 PDT 2008


On May 6, 2008, at 9:08 AM, Matt Welsh wrote:
> Anything that does dynamic resource allocation. There are various  
> implementations of dynamic memory management for TinyOS where this  
> would be useful. TinyOS might have a policy of static allocation  
> for most things, but there are plenty of situations -- memory pool  
> management, thread creation, packet queues, energy scheduling --  
> where an ENORESOURCE would be useful. I think it makes sense to at  
> least have an error code that represents the case of a dynamic  
> resource allocation request was denied.

OK. There's a tradeoff between just queueing the request until the  
resource is available and returning a failure code. For "now or  
never" sorts of operations, the latter is simpler than an x/cancel/ 
xDone(ECANCEL) exchange. Adding an ENORESOURCE is no big deal, but  
moving towards runtime failures being common in the core (i.e.,  
having many interfaces that return ENORESOURCE) would be.

Phil


More information about the Tinyos-devel mailing list