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

Queues: unified, nicer runner method #1816

Merged
merged 8 commits into from
Dec 21, 2023
Merged

Conversation

anshumanmohan
Copy link
Contributor

When hacking on SDN stuff, I came up with a nicer top-level runner method that I wanted all the other queues (FIFO, PIFO, PIFO tree) to start using as well. The important change is that:

Before

The main component would:

  • Have access to external memories and be passed a queue component.
  • Pass all the commands to the queue component in sequence.
  • Stash any answers (gotten from popping or peeking) into the answer memory.

After

The main component:

  • Has access to external memories and is passed:
    • A queue component.
    • An optional controller component.
    • An optional stats component.
  • It sets up runner component that thereafter serves as the handle to the queue component. If main was passed a stats component, it sets up the runner to also use that stats component. The runner has the list of commands, as is in charge of feeding the queue one command at each invocation of the runner. The runner also returns to its caller any answers (from popping or peeking) and raises errors as needed.
  • In a loop, it invokes the runner until the runner raises an error. If passed a controller component, it invokes the controller component every time it invokes the runner. Regardless, the loop runs until the failure of runner.

The SDN clients use the main component with all the optional fields filled, while the lighter-weight FIFO, PIFO, PIFOtree just use it without those fields.

Closes #1770.

@anshumanmohan anshumanmohan enabled auto-merge (squash) December 21, 2023 11:10
@anshumanmohan anshumanmohan merged commit 4101392 into master Dec 21, 2023
5 checks passed
@anshumanmohan anshumanmohan deleted the queues-nicer-runner branch December 21, 2023 11:21
rachitnigam pushed a commit that referenced this pull request Feb 16, 2024
* A little more neatening in SDN

* Make stats component optional in runner

* Make stats component optional in main

* Correctly using the same  method for all queues and SDN

* Nix the old main method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Queues: use the nicer runner
1 participant