[Tinyos-devel] issue with ResourceRequested
Philip Levis
pal at cs.stanford.edu
Sun Aug 10 10:31:56 PDT 2008
On Aug 9, 2008, at 9:48 PM, Eric Decker wrote:
> Thanks for the reply.
>
> The problem is a little more complicated than what I described. So
> while I can think
> of ways to get ResourceDefaultOwner to work but by twisting it a bit.
>
> The twist is A isn't on all the time. When it is, after it has
> made some progress and another
> contender requests then we want A to give the resource up.
>
> So I can get ResourceDefaultOwner to work, if A isn't on then it
> immediately give up
> the resource, otherwise it can determine when to give it up. Not
> too bad.
>
> But perhaps a more general solution would be along the lines of
> adding to the Resource
> interface. I'm playing with Resource.othersWaiting(). This allows
> A to take a look when
> it wants.
>
Again, my concern with an "othersWaiting" is that it only solves the
particular case you're concerned with, where you want a default owner
for power management, then one user which is higher priority than the
others. Because othersWaiting does not tell you who is waiting, you
can't use it for more general priority schemes.
I'd recommend trying to write a PriorityArbiter, which grants the
power lock in terms of priorities specified at compile-time. You
could then add a supplemental, PriortyArbiter-specific, interface,
which allows users to query the status of the priority queue.
Phil
More information about the Tinyos-devel
mailing list