DEV Community


Discussion on: How to know number of tasks can run in parallel in Linux and MacOS

ac000 profile image
Andrew Clayton

On Linux at least, you can also get this at run-time from C (and I dare say other languages) with get_nprocs(3) and/or sysconf(3) with the _SC_NPROCESSORS_ONLN variable.