Re: How do you get thread count in Nim

2017-11-04 Thread JohnS
For Linux systems, this is how I do it in the [psutil library](https://github.com/johnscillieri/psutil-nim): proc cpu_count_logical*(): int = ## Return the number of logical CPUs in the system. try: return sysconf( SC_NPROCESSORS_ONLN ) except

Re: How do you get thread count in Nim

2017-10-30 Thread jzakiya
Yes, that is what I meant, the `threads` that are available per system (all cpu cores), which you can see using commands such as `lscpu` or `htop`.

Re: How do you get thread count in Nim

2017-10-30 Thread Tiberium
TS probably means "processor threads" \- Hyper Threading

Re: How do you get thread count in Nim

2017-10-30 Thread Araq
The docs are correct, there is no such thing as the "number of available threads", threads are dynamic in nature, on some OSes you can create thousands of them.

Re: How do you get thread count in Nim

2017-10-30 Thread jzakiya
Yes, that returns the number of available threads, though its doc says processors/cores.

Re: How do you get thread count in Nim

2017-10-30 Thread dom96
You mean the number of available cores? [https://nim-lang.org/docs/osproc.html#countProcessors](https://nim-lang.org/docs/osproc.html#countProcessors),

How do you get thread count in Nim

2017-10-30 Thread jzakiya
How do you get the number of available system threads inside a Nim proggram?