How do I spawn threads on different CPU cores?

后端 未结 10 2026
梦谈多话
梦谈多话 2020-11-28 20:43

Let\'s say I had a program in C# that did something computationally expensive, like encoding a list of WAV files into MP3s. Ordinarily I would encode the files one at a time

10条回答
  •  無奈伤痛
    2020-11-28 21:16

    One of the reasons you should not (as has been said) try to allocated this sort of stuff yourself, is that you just don't have enough information to do it properly, particularly into the future with NUMA, etc.

    If you have a thread read-to-run, and there's a core idle, the kernel will run your thread, don't worry.

提交回复
热议问题