increasing or decreasing no of cores/processor in java code
am trying to measure the performance of sequential java code and parallel one with the same functionality by varying the no. cores or processors.
I just know how to get the no of cores in java code and I perfectly succeed using it in for the parallel one.
But I just wander if I can check the performance of the sequential one by varying the no of cores or processors.
Is there any way that can decrease or increase the no of cores assigned to the java program? I prefer if I can use some code to do so.
Re: increasing or decreasing no of cores/processor in java code
AFAIK this can't be done from Java. But if you're on a Windows machine, you can set the number of cores you want java.exe to use from the Task Manager. (Right click -> set Affinity...)
Moving this to 'Threads and Synchronization'
db
Re: increasing or decreasing no of cores/processor in java code
Ya from windows that is right but I was trying to run it in remote machine using ssh....I don't really know what option do I have for this