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

65535 threads should be enough for anyone #14014

Closed
joshka opened this issue Nov 16, 2023 · 1 comment
Closed

65535 threads should be enough for anyone #14014

joshka opened this issue Nov 16, 2023 · 1 comment

Comments

@joshka
Copy link

joshka commented Nov 16, 2023

In the API: I'd suggest changing max_threads from 65536 to 65535

The max_threads parameter on the external_engines API methods takes a value 1..65536.
65536 is one more than the max of an unsigned 16 bit int, which means that max threads parameters in API wrappers need to use u32 rather than u16. While this isn't really a problem, it's one that might cause unexpected runtime errors in libraries built around the API.

More generically, if there are other places where counts like this are configured that align with type boundaries, it might be worthwhile choosing (2^8-1), (2^16-1), (2^32 -1) instead of those powers of 2.

@joshka
Copy link
Author

joshka commented Nov 16, 2023

Moved to lichess-org/api#291

@joshka joshka closed this as completed Nov 16, 2023
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