Question

cjalal on Fri, 05 Aug 2016 15:56:49


I'll be able to post an actual picture of this phenomenon later on today -- but in the Windows task manager, only 50% of my CPU is being utilized, whilst in the CPU %usage in Visual Studio shows 100% usage... would anyone know this problem?

I have a dual socket motherboard with two CPU's installed -- 2x18 cores (72 threads).

I created 70 threads -- which causes the CPU usage in Visual Studio to go to 100% (however in the task manager it only goes up to 50%) for the entire duration of the program (which is at least several minutes).

Does anyone have any idea what could be causing this, and if there's a solution? Thanks.


Sponsored



Replies

cjalal on Fri, 05 Aug 2016 19:36:55


In Visual Studio C++ it says my CPU usage is 100%, but in task manager is shows only 50%. I think this is because I have a dual socket motherboard, and it's only using one socket's CPU chip. Does anyone know what might be causing this?

I used <thread> to create enough threads to use all hyperthreaded CPU cores on both physical processors.

seccpur on Sat, 06 Aug 2016 03:10:04


Use thread_pool instead and std::this_thread->yield() to release some CPU cycles for other threads. 

I feel your problem is due to mismanagement of threads and not hardware issue because many worker threads might be simultaneously asking for cpu cycles. These workers need to be spacial sparse.

Sera Yu on Mon, 08 Aug 2016 06:36:58


Hi cjalal,

thanks for posting here.

This forum is about c++ development. For your case which is more related to Windows Usage, I suggest you go to Microsoft Community for better support.

Your understanding and cooperation will be grateful.

Best Regards,

Sera Yu

Sera Yu on Mon, 08 Aug 2016 08:04:39


Hi cjalal,

please don't post same cases on MSDN. According to the policy, I will merge this case to your earlier case.

https://social.msdn.microsoft.com/Forums/vstudio/en-US/00a096e1-a5c8-4d8c-bec9-58b5b9701e0c/visual-studio-c-is-only-using-one-cpu-on-dualsocket-motherboard?forum=vclanguage

Your understanding and cooperation will be grateful.

Best Regards,

Sera Yu