Attempting multithreading in Windows under MingGW64

Hi ya'll

I'm' attempting to run a multithreaded process by using

std::for_each(std::execution::par_unseq, ...

the program works correctly but when I look at my Task Manager I see only one logical processor running at 100%. The others are quite flat near 0. This leads me to conclude the work isn't being done in parallel like I hoped.

I recently installed MSYS2 and compiled the program under MinGW64 with the follow
g++ -std=cpp++17 main.cpp ../external/lodepng/lodepng.cpp

Looking online for problems with MinGW64 only brought me to people failing to compile or run their program.

Any help or new direction is greatly appreciated :).

Cheers,

If the implementation cannot parallelize or vectorize (e.g. due to lack of resources), all standard execution policies can fall back to sequential execution.
https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag_t
I agree something the execution policy is falling back to sequential.
I'm not sure why this might be though.

It certainly isn't a lack of resources as I have a 16 core machine with nothing else running.

I suspect I have to do something with MinGW64 to get threads working. Would you know what would need to be done?
It could be just the implementation, and nothing to do with your environment.
Registered users can post here. Sign in or register to post.