lundi 26 janvier 2015

Is there a way to change the number of processors a program sees?


Is there any way I can trick a program into thinking the system has fewer processors? To explain: I am debugging a program that creates as many threads as it has processors, using sysconf(_SC_NPROCESSORS_CONF);. I'd like to test it using only one threat. Strictly for convenience, I'd like to know if there's a way I can trick the program into thinking the computer only has one processor, to avoid having to add a command line option or changing the code to temporarily only create one thread.



Aucun commentaire:

Enregistrer un commentaire