Is there any evidence to suggest that by manually picking which processor to run a thread on you can improve system performance?
For example say you dedicated the thread that does the most work to one core and all other “helper” threads to a second.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I can’t see that there is a case for this.
Remember that any multiprocessor enabled OS will automatically allocate processor time as it sees fit in an attempt to balance out processor loading.
This means that in reality any process thread that you have running will be constantly interrupted, based on the thread priority, so that the OS can allocate processor time to other processes. Individual computations within the same thread may not even be executed on the same processor.
If you fixed process code to run on just the one specified processor then this would likely hinder its performance as it would not allow the OS to balance processor loading.
I suppose that you could make large parts of it a critical section but this would hinder your application in other areas, especially the processing of any sub threads.