Parallel : get cpu usage ?

Larry deco33 at hotmail.fr
Sun Dec 22 01:04:17 PST 2013


The more I use D, the more I like it.

Is there a way to get cpu usage to dynamically set the parallel 
options ?

E.g : I have a dual core, if cpu usage is superior than x, then 
blah.

It would be interesting to :

- to be able to set the execution logic based on the cpu 
capability
- as a consequence of the latter, setting the nice value of the 
current thread dynamically.
- As a consequence of both : to avoid the cpu to burn.


Conclusion :
So it would be useful to have a "std" way to set the nice of the 
pid, and get the cpu usage and eventually deciding on which core 
-obviously the least busy- the parallel will start on and then, 
eventually, deploy to.

Did I miss a hidden functionality that already does this ?

Thanks


More information about the Digitalmars-d mailing list