Home » U++ Library support » U++ MT-multithreading and servers » Can't use MT to capture console output
|
|
|
Re: Can't use MT to capture console output [message #61202 is a reply to message #61189] |
Wed, 04 December 2024 10:34   |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
I've tested on U++ 12587 and the test case I uploaded, unmodified, with an exe that prints 100k lines of code finishes almost instantly and gets captured, no Sleep needed.
With latest U++ this hangs or lags, as described.
With 1000 times as many outputs, both hang. But a Sleep of (1) on the old U++ version makes it super responsive, much better than Sleep(10) on the new U++.
Also, the old U++ is on an old PC. Read slow. I had to revive it from storage just for this test. The new one is on a cutting edge (from 3-4 years ago) Intel CPU. So the new U++ on new PC is more laggy than old U++ on old PC.
This reminds me of many years ago, when I was first trying to get this going and it was a complete mess. My solutions didn't work. If I remember correctly, I took inspiration from TheIDE sources and this single line fixed all the issues:
void Append(const String& s) {
Insert(total, s); // THIS
}
Inserting to "total" position and only there, made it work. I'm guessing that turns it into an "append", not an "insert".
I'll try and find an ever older U++ than 12587, and maybe one in the middle . But I doubt I'll find one.
|
|
|
Re: Can't use MT to capture console output [message #61203 is a reply to message #61202] |
Wed, 04 December 2024 10:55  |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
Ha, the issue is more complicated than it seems.
I have two programs outputting 100k numbers, one with STD C++ and one with a custom "cout" solution.
One is much slower than the other for no good reason, just a loop printing numbers from 0 to 99K.
The size of the Output console is another variable. With STD C++ there are no noticeable differences, but with the custom, Console capture is very laggy.
I'll dig into this more.
This is probably something very stupid, like it usually is with MT issues...
|
|
|
Goto Forum:
Current Time: Fri Apr 25 07:58:07 CEST 2025
Total time taken to generate the page: 0.00764 seconds
|