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

Feature request: Set thread priority in NameableThreadFactory #173

Closed
ghost opened this issue Jul 12, 2022 · 1 comment
Closed

Feature request: Set thread priority in NameableThreadFactory #173

ghost opened this issue Jul 12, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 12, 2022

In our application, we have, essentially, two high-priority, real-time processing threads. The rest of the application assigns threads to low-priority. The following lines in NameableThreadFactory pin the thread to priority level 5:

    if (t.getPriority() != 5) {
        t.setPriority(5);
    }

(Aside, is that if condition superfluous? Could the code set the priority regardless of its current value? Setting pri 5 back to pri 5 would effectively be a no-op.)

We'd like to build a DBusConnection to process signals at the lowest possible priority level, such as:

return DBusConnectionBuilder
  .forSessionBus()
  .withThreadPriority(Thread.MIN_PRIORITY)
  .build();
@ghost ghost changed the title Set thread priority in NameableThreadFactory Feature request: Set thread priority in NameableThreadFactory Jul 12, 2022
@hypfvieh
Copy link
Owner

I added the option to change the priority for every thread factory used in ReceivingService using DBusConnectioBuilder/DirectConnectionBuilder. Please check if this is suitable for you.

@ghost ghost closed this as completed Jul 13, 2022
This issue was closed.
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