[Tinyos-host-mote-wg] Re: [Tinyos-2.0wg] Resource handles

David Gay dgay42 at gmail.com
Fri Oct 21 18:27:49 PDT 2005


On 10/21/05, Cory Sharp <cory at moteiv.com> wrote:
> One thing I want is to immediately satisfy requests if possible,
> otherwise defer.  This is (at least for me) what I commonly want from
> the arbiter.  Of course, it's possible to do that in TOS2 with this
> technique:
>
>   void doSomethingGranted() {
>     // use the resource
>     call Resource.release();
>   }
>
>   void doSomething() {
>     if( call Resource.immediateRequest() )
>       doSomethingGranted();
>     else
>       call Resource.request();
>   }
>
>   event void Resource.granted() {
>     doSomethingGranted();
>   }
>
> That pattern becomes tedious if you use it a lot.

As far as I can tell, this issue has nothing to do with the rh
(resource handle) thing? You want an async request that immediately
signals granted if the resource is available? (your Urgent interface
proposal from the 1st mail? it would help to be more explicit...)

If so, one issue is that this pattern is likely to lead to deeper call
stacks (inlining won't do miracles in this case, at a guess), and, if
you're careless, recursive loops. Not so nice...

David

_______________________________________________
Tinyos-2.0wg mailing list
Tinyos-2.0wg at Mail.Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-2.0wg


More information about the Tinyos-host-mote-wg mailing list