Skip to content
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

Pending Actions waiting for Preferred actions Optimization #110

Open
tomtzook opened this issue Feb 15, 2024 · 1 comment
Open

Pending Actions waiting for Preferred actions Optimization #110

tomtzook opened this issue Feb 15, 2024 · 1 comment

Comments

@tomtzook
Copy link
Member

When a new action first encounters a preferred action, it discovers so in the conflicts check. It is then placed in the pending list, as seen in SingleThreadedScheduler.start and SingleThreadedScheduler.tryStartingAction. However, for each subsequent Scheduler.run call until the preferred action stops, the pending action will do the same requirements check again and again. Time may be optimized into a push event instead of pulling on the requirements again and again.

One possibility is to require the running action or the relevant requirement to hold a queue of waiting actions and inform them once the requirement was released.

The same is true for default actions, as SingleThreaded.Scheduler.canStartDefaultAction is checked way too much and it requires multiple loops.

@tomtzook
Copy link
Member Author

tomtzook commented Feb 18, 2024

Same goes for default actions waiting really.

Could make a list of "requests" for running on a subsystem and when a subsystem is freed, alert that an action is ready to start.

It would also solve a potential problem of new action superseding the pending action. Though maybe we don't want to go into a queue methodology.

Allow also rejecting incoming actions instead of just pending them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant