CPU Count API to support Threads?

Sometimes the Haxe code I write is fairly CPU intensive even after compiler Optimizations.
I want to limit the number of Threads my application uses to be well behaved and not heavily use all available CPU cores / Hyperthreads.

Knowing the number of available cores / hyperthreads would help me keep my application on the well behaved side.

I searched in 4.0 rc2 sources and did not find any CPU count or similar.

What am I missing ?

Which platform do you mean ?

You could adapt this for your own use.


Awesome link! Thanks Jens

Perhaps this is a good starting point to improve Haxe 4.0 Thread support?