内核线程之间的.NET运动 [英] .NET movement of threads between cores

查看:145
本文介绍了内核线程之间的.NET运动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请从多核心使用,线程,线程池的问题

  
    

在线程从一个核心到另一个在其一生中移动?

  
     

当然。想象一下,你有三个   在dualcore系统运行的线程。   让我看到不公平的时间表   包括定期运动主题   核心之间。

这是我第一次在这个网站,所以我没有足够的代表处发表评论我猜。我决定只让一个新的问题,引用一个我想发表评论。

这是选择一个核心移动至一个线程的过程。是不是像调度程序需要处理时间线程的列表,并为一个完成它使一个又一个的?

另外我想知道如果有一个线程被所有核心之间移动的语句引用。或者只是认为共同knowlege?

谢谢!

解决方案

它不像线程生活在一个特定的核心,它是一个过程的移动的到另一个。

操作系统简单地具有螺纹(和/或过程),其准备好执行并分派它们的任何核/ cpu的碰巧是可用的列表。

这就是说,任何智能调度器将尝试安排在同一个芯线尽可能 - 简单地提高性能(数据更可能是在该核的高​​速缓存等)

Follow up question from Multi-core usage, threads, thread-pools.

Are threads moved from one core to another during their lifetime?

Of course. Imagine you have three threads running on a dualcore system. Show me a fair schedule that doesn't involve regularly moving threads between cores.

This is my first time on this site, so I didn't have enough rep to comment I guess. I decided to just make a new question referencing the one I wanted to comment on.

What is the process of selecting a core to move a thread to. Is it like the scheduler has a list of threads that need processing time and as one finishes it puts another one in?

Also I was wondering if there is a reference for the statement that threads are moved between cores at all. Or is it just considered "common knowlege"?

Thanks!

解决方案

It's not like the thread is living on a particular core and that it is a process of moving it to another.

The operating system simply has a list of threads (and/or processes) that are ready to execute and will dispatch them on whatever core/cpu that happens to be available.

That said, any smart scheduler will try to schedule the thread on the same core as much as possible - simply to increase performance (data is more likely to be in that core's cache etc.)

这篇关于内核线程之间的.NET运动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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