Conversation
|
|
||
| virtual void saveState() = 0; | ||
|
|
||
| virtual bool hasPriority() { return false; } |
There was a problem hiding this comment.
Maybe at least the interface should be able to hande different priorities?
We could define some integer constants like HIGH_PRIORITY, DEFAULT_PRIORITY and have defined behaviour only for these. I imagine we want to have LOW_PRIORITY somewhen in the future.
There was a problem hiding this comment.
added comment.
integer constants sound good, but I don't think it is necessary.
| struct SetPriority : public InvocationBase { | ||
| constexpr static uint16_t label = (proto<<8) + SET_PRIORITY; | ||
| SetPriority(bool priority) | ||
| : InvocationBase(label,getLength(this)), priority(priority) {} | ||
| bool priority; | ||
| }; |
There was a problem hiding this comment.
I'm not sure if we should limit that to a bool. See comment on interface. setPriority(false) could be hard to interpret.
| // or if if current ec got ready in case of race condition | ||
| if (current == nullptr || current == ec) home->preempt(); | ||
| // wake up the hardware thread if it has no execution context running | ||
| // or if if current ec got ready in case of race condition |
There was a problem hiding this comment.
If a running EC priority has been set to default from another hw thread (-> without interrupting it), this should also be enough to prevent the EC from running if there is another high priority EC waiting to run.
There was a problem hiding this comment.
yes, but I don't want to handle this special case.
#211
tested on qemu