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

Thread priority class #122

Closed
IlTeo285 opened this issue Oct 26, 2023 · 1 comment
Closed

Thread priority class #122

IlTeo285 opened this issue Oct 26, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@IlTeo285
Copy link

It's very useful to be able to set the thread priority class. In a general sense, this can be achieved by exposing the native handles to the caller like this.

    [[nodiscard]] std::vector<std::thread::native_handle_type> get_threads_raw_handle() const
    {
        std::vector<std::thread::native_handle_type> raw_hndls;
        for (concurrency_t i = 0; i < thread_count; ++i)
        {
            raw_hndls.push_back(threads[i].native_handle());
        }

        return raw_hndls;
    }

Another approach could be to accept a user callback to be called during the thread creation phase.

@IlTeo285 IlTeo285 added the enhancement New feature or request label Oct 26, 2023
@IlTeo285 IlTeo285 changed the title [REQ] Thread priority class Oct 26, 2023
@bshoshany
Copy link
Owner

Thanks for the suggestion! This looks like it might be useful. I will add it (with slight changes and an example in the documentation) to v3.6.0, which should be available within the next few weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants