I have a feeling the answer to this is no, but using .Net 4.0's Parallelism, can you set the amount of cores on which to run i.e. if your running a Quad Core, can you set your Application to only use 2 of them?
Thanks
To configure the max degree of parallelism optionIn Object Explorer, right-click the desired instance and select Properties. Select the Advanced node. In the Max Degree of Parallelism box, select the maximum number of processors to use in parallel plan execution.
If you are on a single host, a very effective way to make use of these extra cores is to use several R instances at the same time. The operating system will indeed always assign a different core to each new R instance. In Linux, just open several the terminal windows. Then within each terminal, type R to open R.
SQL Server Degree of Parallelism is the processor conveyance parameter for a SQL Server operation, and it chooses the maximum number of execution distribution with the parallel use of different logical CPUs for the SQL Server request.
Yes, it is a built-in capability of Parallel.For(). Use one of the overloads that accepts a ParallelOptions object, set its MaxDegreeOfParallelism property. For example:
using System;
using System.Threading.Tasks;
class Program {
static void Main(string[] args) {
var options = new ParallelOptions();
options.MaxDegreeOfParallelism = 2;
Parallel.For(0, 100, options, (ix) => {
//..
});
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With