我试图监视windows服务器上有24个处理器的windows服务CPU的使用情况。我用过
_cpuCounter = new PerformanceCounter(
"Process", "% Processor Time", Process.GetCurrentProcess().ProcessName, true);
_cpuCounter.NextValue()/100 //most time, it is more than 100%, which is not correct.
但是它并
我目前正在处理的脚本,使一些检查和插入的每个数据库的Mongo服务器。它是多线程的。
for (int i = 0; i < countDatabase; i++) {
new threadDatabase(database.get(i).toString()).start();
}
问题:我有16个数据库要解析……我担心设置脚本的PC无法管理16个(或更多)线程……
有没有办法处理大量的线程?我听说过池,但不确定它是否能处理我作为参数发送的数据库名称……
谢谢