为每个线程CPU核心 [英] assign each thread a cpu core

查看:104
本文介绍了为每个线程CPU核心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经写在.NET 4中使用线程定期做的工作窗口服务。 服务器有超过20个CPU核心。

i have a windows service written in .net 4 which doing jobs periodically using Threads. the server has more than 20 cpu core.

我创造我的窗口服务10个线程。是否有可能分配给每个线程CPU内核?

i create 10 threads in my windows service. is it possible to assign each thread a cpu core?

推荐答案

该操作系统已经这样做了precisely你们。它并不能保证每个线程的的相同的核心永远(并在几乎所有情况下,有没有必要,要么),但它的确实的尽量保持许多繁忙内核成为可能。这意味着给所有可用线程自身的核心尽可能的。

The OS already does precisely that for you. It doesn't guarantee that each thread will stay on the same core forever (and in nearly all cases, there's no need for that either), but it does try to keep as many cores busy as possible. Which means giving all available threads their own core as much as possible.

这篇关于为每个线程CPU核心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆