In Windows, all threads are not created equal! :)
-
Just split a big job into three main threads in Windows. The first of them took longer to run than the other two (on a 4 core processor). Unfortunately, I can't exactly qualify it without re-running the almost 8 hour jobs on my 3.2 GHz machine. But two of the threads completed about an hour or more before the first thread! The last two completed at roughly the same time, far before the first of them.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
-
Just split a big job into three main threads in Windows. The first of them took longer to run than the other two (on a 4 core processor). Unfortunately, I can't exactly qualify it without re-running the almost 8 hour jobs on my 3.2 GHz machine. But two of the threads completed about an hour or more before the first thread! The last two completed at roughly the same time, far before the first of them.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
Could be a ton of reasons why, but assuming it's the same code in all three threads, keep in mind there is such a thing as processor affinity and thread affinity. The whole concept of parallelism is a mirage. Computers are just so fast at context switching it seems that way, but this concept is why they have thread scheduling, etc. In _theory_ it's a lot like preemptive multitasking in Windows, but it's on a hardware level and thus much, much quicker with less crap in the way. But, even with a multi-core CPU, something's gotta manage what gets ran. At least that's how it was back in my multithreaded days before multi-core became the norm but hyperthreading was a thing. These days in JavaScript land, threads scare people. :laugh:
Jeremy Falcon
-
Just split a big job into three main threads in Windows. The first of them took longer to run than the other two (on a 4 core processor). Unfortunately, I can't exactly qualify it without re-running the almost 8 hour jobs on my 3.2 GHz machine. But two of the threads completed about an hour or more before the first thread! The last two completed at roughly the same time, far before the first of them.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
Let us also not forget there's thousands of other threads running in Windows that your process has to share those four cores with.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak -
Just split a big job into three main threads in Windows. The first of them took longer to run than the other two (on a 4 core processor). Unfortunately, I can't exactly qualify it without re-running the almost 8 hour jobs on my 3.2 GHz machine. But two of the threads completed about an hour or more before the first thread! The last two completed at roughly the same time, far before the first of them.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
-
Just split a big job into three main threads in Windows. The first of them took longer to run than the other two (on a 4 core processor). Unfortunately, I can't exactly qualify it without re-running the almost 8 hour jobs on my 3.2 GHz machine. But two of the threads completed about an hour or more before the first thread! The last two completed at roughly the same time, far before the first of them.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
Quote:
into three main threads in Windows.
You like to say with that you created _three_ threads in your _one_ process? If yes, don't be surpriced about your measurements. My expercience with windows is: In case you like to gain full cpu, span the work over multiply processes, instead of multiply threads in one process ;)
-
Just split a big job into three main threads in Windows. The first of them took longer to run than the other two (on a 4 core processor). Unfortunately, I can't exactly qualify it without re-running the almost 8 hour jobs on my 3.2 GHz machine. But two of the threads completed about an hour or more before the first thread! The last two completed at roughly the same time, far before the first of them.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
Every I/O is an interrupt.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
-
Just split a big job into three main threads in Windows. The first of them took longer to run than the other two (on a 4 core processor). Unfortunately, I can't exactly qualify it without re-running the almost 8 hour jobs on my 3.2 GHz machine. But two of the threads completed about an hour or more before the first thread! The last two completed at roughly the same time, far before the first of them.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
Did you also set your priority among threads? Honestly, I find my best performance in C# using the Task Parallel Library[^], letting it decide threads versus tasks, priorities, etc.