-
Notifications
You must be signed in to change notification settings - Fork 574
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
Allow fibers to have a wider range of priorities #202
base: master
Are you sure you want to change the base?
Conversation
It looks like the test failed due to integer overflow and underflow. This seems like a bug in the test, so I also pushed a change to exclude these two special cases from failing. |
I am not going to merge it at this time, but in any case, there's a mistake in your code: |
Thanks for the feedback! I just fixed one small bug, but I can't find the bug that you're describing. The static methods are never actually used when creating a I probably caused some confusion by naming them the same as the removed static fields and not updating the Let me know if I'm misunderstanding what you mean. |
Thank you both for your work on this issue! I think that having only 10 priorities is too limiting for my use case. Having a range from -231 to 231-1 is better, but still not general. I think that ideally either a As discussed previously, there may be some contention on the queue, but I think it would be nice to leave it up to the user to decide if the trade-off is worth it. |
|
I've actually been working on a proof of concept for using relative ordering. You can find the repository here. I've managed to get it working except it would require 2 small changes to the
Both of these class members could probably also be made final as well. This is necessary because I am making a subclass of
I may be overlooking something, so please let me know if you know of a simpler solution. |
I don't understand. Why not just subclass You could use it like so
Actors should not be at all involved with scheduling. |
Thanks for the advice. I've updated the example repo to no longer require a subclass of This update, however, now requires a subclass of If the visibility of A somewhat unimportant side note: |
I don't think you need to subclass |
@pron Thanks for the feedback! Hopefully I'm now implementing this better. You were right, creating that subclass was unnecessary. Prioritizing the tasks is possible without any modification to the quasar code. 😄 I think I was trying to subclass I pushed some changes to remove the need to subclass of Thanks again for your help @pron! @disposableme I hope this code helps! |
As discussed in #195.
This PR can be used if having a wider range of priorities turns out to be useful. Fibers are no longer restricted to the same priority range as a Thread. Hopefully this does not complicate the code too much.
I'm not sure if this follows correct code conventions consistent with the rest of the project, so please let me know if there are any minor things that I should fix.
@pron I realize that you already stated that you are reluctant to make this change unless there is a compelling reason, so please treat this PR as merely a suggestion in the event that a compelling reason arises. If there is not a good reason to make the change, then feel free to reject the PR. I just wanted to post this in case it is useful to anyone or saves you some time. 😄