Hi all,

I have a small C++ program using <thread>. Mainly, I have a series of long 
tasks for which I can use a chosen number of threads. I create a given number 
of instances of the std::thread class, each executing the same function but 
with different data. After launching the threads, my program waits for the 
results by calling thread.join() on each thread. Some threads finish sooner 
than others, depending on the data they process.

I have 16 cores with hyperthreading, so 32 virtual cores. I tried a big run 
with 63 threads.

If I compile as a Cygwin program with g++ 10.2.0, when the program runs with 63 
threads the CPU load for the program never exceeds 6 or 7%. It remains 
constants when some of the threads finish, unless the number of threads 
remaining goes down to about 4.

If I compile as a Mingw program with x86_64-w64-mingw32-c++ 10.2.0, when the 
program runs with 63 threads the CPU load for the program reaches 98% then 
gradually diminishes as threads finish their task.

Needless to say, the total running time for the Mingw version is much shorter.

So, is there a limit to the CPU load that a threaded Cygwin program can get? If 
yes, how can it be changed?

Regards,

- André Bleau

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to