Skip to content

Include Haiku in processor count checks - #3326

Merged
martin-frbg merged 1 commit into
OpenMathLib:developfrom
wattoc:develop
Jul 28, 2021
Merged

martin-frbg merged 1 commit into
OpenMathLib:developfrom
wattoc:develop

Conversation

@wattoc

@wattoc wattoc commented Jul 27, 2021

Copy link
Copy Markdown
Contributor

Haiku should be performing processor count checks and using them to limit thread creation as the other OS's do.

This is currently being patched in on HaikuPorts against 0.3.17: haikuports/haikuports#6094

@brada4

brada4 commented Jul 27, 2021

Copy link
Copy Markdown
Contributor

Is this correct CPU number detection?

#ifdef OS_HAIKU
int get_num_procs(void) {
  static int nums = 0;
  if (!nums) nums = sysconf(_SC_NPROCESSORS_CONF);
  return nums;
}
#endif

@wattoc

wattoc commented Jul 28, 2021

Copy link
Copy Markdown
Contributor Author

Yes, Haiku supports this call and it is used by other apps to count CPUs:

https://github.com/haiku/haiku/search?q=_SC_NPROCESSORS_CONF

@martin-frbg martin-frbg added this to the 0.3.18 milestone Jul 28, 2021
@martin-frbg
martin-frbg merged commit f681553 into OpenMathLib:develop Jul 28, 2021
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.

3 participants