-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements more EBUSY on Resource.request() (TEP108) #255
base: master
Are you sure you want to change the base?
Conversation
👍 |
+1 |
+1 not sure what you mean by risky to merge it. it is broken. if existing code takes advantage of this misbehaviour then On Thu, Feb 27, 2014 at 11:56 AM, András Bíró [email protected]:
Eric B. Decker |
Because there's a lot of lib/driver with no support. Most of the supported lib/driver is supported by one person, if she/he doesn't have time right now, a possible bug won't be fixed for a while. |
seems like a reasonable plan to me. +1 anyone else any thoughts? If not I'll merge this in at the end of this week. On Mon, Mar 3, 2014 at 8:30 AM, András Bíró [email protected]:
Eric B. Decker |
Was this merged in? |
not merged. there was some concern (Biro) that it might break things. I asked if anyone else had any comments but got nothing back. given the possibility of breakage, I errored on the side of caution. I But yes we should merge this. On Fri, Apr 18, 2014 at 1:56 AM, phil-levis [email protected]:
Eric B. Decker |
I also said "Probably we should merge it, and see what happens. If something bad, we can still undo it, and reopen this bug." |
Hello. I have some question to coauthor Philip Levis: My patch allows "queue" request if it is called during "state!= RES_GRANTING" (for example from Resource.granted() task). I think that is correct reaction. Can coauthor Philip Levis (or someone else) propose some solution/patch for ArbiterP.nc and FcfsPriorityArbiterC.nc ? Thanks, Martin Cerveny |
It doesn't always return SUCCESS; it could return non-SUCCESS if the request is not enqueued properly. If I recall correctly, we moved to returning SUCCESS on requests rather than EBUSY because it makes managing state machines in callers easier. Basically, SUCCESS means "you will receive a granted event." 108 doesn't say EBUSY is a MUST. I think that logically your fix looks good. But before I pull it, I need you to you could use formatting in line with most TinyOS code (e.g., have braces for the else clause, etc.). Thanks! |
Hello. On Sat, 19 Apr 2014, phil-levis wrote:
More precisely Example: TestResourceC.nc: configuration TestResourceC {
} TestResourceM.nc: #define NEW_PRINTF_SEMANTICS 1 module TestResourceM { implementation {
} Output:
Program is stopped and resource is not planned anymore again! If FcfsArbiterC is replaced by SimpleFcfsArbiterC (based on patched Output:
If FcfsArbiterC is replaced by SimpleFcfsArbiterC (based on ORIGINAL
The caller can simply ignore return code (EBUSY says - already planned).
??? M.C> |
OK, it sounds like the arbiter implementations are completely inconsistent. What's important is to give them the same calling and event behavior. I'd argue that the correct behavior is the middle one, which is from your patch to SimplerArbiterP. The other Arbiters should have this behavior as well. Do you agree? |
On Sun, 20 Apr 2014, phil-levis wrote:
Yes. M.C> |
OK. The one challenging bit here is a lot of moving parts depend on the arbiter interfaces. I'm pegged until May 1, but in May can start spending some time on this. I think moving all of the Arbiters to having a uniform call/response semantics and verifying their use in other components would be a great step forward. The reason this second part is tricky is the integration with power management. Coming up with test cases for the calling semantics is not hard (e.g., yours above) but locks on buses etc. are used in many places. |
Alright, finally emerging from the post-spring-quarter backlog. Let's clean up the arbiters. This is going to be a tricky job, because so many components depend on them. Let's coordinate on Skype? My id is tinyos. Or we can do email. |
Martin, I checked out your patch and it's good. I've also written a patch for the non-simple Arbiter. The trick is going to be testing this across the components of the system. Unfortunately I'm about to leave for 10 days of vacation -- I will do the complete testing when I return. Here's my patch (it includes yours, slightly edited):
|
There is problem with multiple calls to SimpleArbiterP.nc Resource.request().
Problem description - call 3x Resource.request() in one task:
TEP108: 3.1 "... If a client ever makes multiple requests before receiving a granted event, an EBUSY value is returned, and the request is not queued. ..."
I suppose that correct return code for 3) is EBUSY too and NOT queue request.
I have problem with that, Resource.granted is called 2 times and if I do everything with first call,
there is no work for the second call.
There are similar problems with ArbiterP.nc (that return SUCCESS instead EBUSY), FcfsPriorityArbiterC.nc.