[Tinyos-help] Resource.reserve returns EBUSY forever after some time

Sandip Bapat sandipbapat at yahoo.com
Fri Mar 28 16:44:25 PDT 2008


I agree with Phil. Nonetheless, I used Jan's idea and now the mote gets stuck in a state where the Resource.request is no longer called. This means that I reach a state where I am still the owner of the resource when the Timer fires. 

Is it possible for Resource.release to either fail or not do the housekeeping its supposed to do? If a release fails for some reason, it would explain what I am seeing - the ADC still thinks I'm the owner but all of my subsequent requests are enqueued but never granted. 

Thanks
Sandip



----- Original Message ----
From: Philip Levis <pal at cs.stanford.edu>
To: Jan Hauer <jan.hauer at gmail.com>
Cc: Sandip Bapat <sandipbapat at yahoo.com>; tinyos-help at millennium.berkeley.edu
Sent: Friday, March 28, 2008 5:20:05 PM
Subject: Re: [Tinyos-help] Resource.reserve returns EBUSY forever after some time


On Mar 28, 2008, at 7:34 AM, Jan Hauer wrote:

> You should make sure that you don't call Resource.request() while
> you're still owner. You could do it by keeping state in some module
> variable, but you could also do it through "if (!call
> Resource.isOwner()) call Resource.request();" in your Timer.fired().
> Note that this means, that your samples might not be taken at regular
> intervals (you lose a sample when isOwner() returns FALSE)


That's not right. It should be valid to request while owner: this  
enqueues a request, which will be serviced (after possibly others)  
once release() is called. TEP 108 is very clear on this.

Phil


      ____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com


More information about the Tinyos-help mailing list