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

Support forced ranking for "high" workers #6

Open
mmccool opened this issue Sep 25, 2023 · 1 comment
Open

Support forced ranking for "high" workers #6

mmccool opened this issue Sep 25, 2023 · 1 comment

Comments

@mmccool
Copy link

mmccool commented Sep 25, 2023

Problems:

  • If you just have "high" and "low", devs will abuse it (mark everything as high)
  • In practice, there are a limited number of high performance threads available
  • We can't necessarily share the number of high performance threads with the dev (fingerprinting risk, maps to number of P-cores, reveals details of platform, etc).

Idea: Use forced ranking for "high" workers:

  • Within Workers marked as "high", devs need to place them in order from most to least important
  • This can be done with a number, e.g. 1, 2, 3 - with no duplicates, lowest number most important
  • Workers would be assigned to the "high" thread pool in order by rank; when the high thread pool is exhausted, the remainder will be run on the "low" pool
  • A default rank can be assigned using the order of Worker creation, but an explicit rank can also be provided to avoid having to re-juggle code order when deciding on priority
  • No rank needed or implied for "low" Workers
  • Default value should be "low" to encourage use of E-cores and improve energy efficiency in default case
@mmccool
Copy link
Author

mmccool commented Sep 25, 2023

More thoughts:

  • If duplicate a rank, should cause an error
  • If want to modify ranks after a worker has started... may cause a duplicate if done naively. Suggest adding a method to swap the ranks of two workers
  • Should also be possible to assign a rank to a low worker, so if its priority is changed to high it can be taken into account

Some of the above relates to issue #5

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

No branches or pull requests

1 participant